Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.elasticsearch.painless.ArrayTests tests fail when running on JDK 11 #31500

Closed
alpar-t opened this issue Jun 21, 2018 · 10 comments
Closed

org.elasticsearch.painless.ArrayTests tests fail when running on JDK 11 #31500

alpar-t opened this issue Jun 21, 2018 · 10 comments
Assignees
Labels
:Delivery/Build Build or test infrastructure jdk11 Team:Delivery Meta label for Delivery team >test-failure Triaged test failures from CI

Comments

@alpar-t
Copy link
Contributor

alpar-t commented Jun 21, 2018

feature branch: feature/31230_gradle48_jdk11

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+31230_gradle48_jdk11+matrix-java-feature-branch/5/ES_BUILD_JAVA=java10,ES_RUNTIME_JAVA=java11,nodes=virtual&&linux/#showFailuresLink

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+31230_gradle48_jdk11+matrix-java-feature-branch/5/ES_BUILD_JAVA=java11,ES_RUNTIME_JAVA=java11,nodes=virtual&&linux/#showFailuresLink

java.lang.AssertionError: 
Expected: "6"
     but: was "Index 6 out of bounds for length 5"
	at __randomizedtesting.SeedInfo.seed([AF4A4AFC8D181DA4:D77E913660E3067D]:0)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:956)
	at org.junit.Assert.assertThat(Assert.java:923)
	at org.elasticsearch.painless.ArrayLikeObjectTestCase.expectOutOfBounds(ArrayLikeObjectTestCase.java:88)
	at org.elasticsearch.painless.ArrayLikeObjectTestCase.arrayLoadStoreTestCase(ArrayLikeObjectTestCase.java:55)
	at org.elasticsearch.painless.ArrayLikeObjectTestCase.testLongsInDef(ArrayLikeObjectTestCase.java:98)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1713)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:907)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:943)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:957)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
	at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:916)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:802)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:852)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:863)
	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
	at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
	at java.base/java.lang.Thread.run(Thread.java:832)
	Suppressed: java.lang.ArrayIndexOutOfBoundsException: Index 6 out of bounds for length 5
		at java.base/java.lang.invoke.MethodHandleImpl$ArrayAccessor.getElementJ(MethodHandleImpl.java:168)
		at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:707)
		at org.elasticsearch.painless.DefBootstrap$PIC.fallback(DefBootstrap.java:211)
		at org.elasticsearch.painless.PainlessScript$Script.execute(def x = new long[5]; return x[ 6]:30)
		at org.elasticsearch.painless.ScriptImpl.run(ScriptImpl.java:105)
		at org.elasticsearch.painless.ScriptTestCase.exec(ScriptTestCase.java:106)
		at org.elasticsearch.painless.ScriptTestCase.exec(ScriptTestCase.java:86)
		at org.elasticsearch.painless.ArrayLikeObjectTestCase.lambda$expectOutOfBounds$0(ArrayLikeObjectTestCase.java:81)
		at org.elasticsearch.painless.ScriptTestCase.expectScriptThrows(ScriptTestCase.java:136)
		at org.elasticsearch.painless.ScriptTestCase.expectScriptThrows(ScriptTestCase.java:129)
		at org.elasticsearch.painless.ArrayLikeObjectTestCase.expectOutOfBounds(ArrayLikeObjectTestCase.java:80)
		... 38 more
@alpar-t alpar-t added :Delivery/Build Build or test infrastructure >test-failure Triaged test failures from CI labels Jun 21, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@bleskes
Copy link
Contributor

bleskes commented Jun 21, 2018

@atorok is this something you're looking at or would you like @jdconrad to have a look?

alpar-t added a commit that referenced this issue Jun 21, 2018
@alpar-t
Copy link
Contributor Author

alpar-t commented Jun 22, 2018

I haven't looked at it yet, my focus is to map all JDK11 related issues first by muting anything that fails and then picking them up. I'm find either way, let's just make sure to ping here if we start working on it to make sure we don't do it at the same time.

@s1monw
Copy link
Contributor

s1monw commented Jun 25, 2018

I agree with @bleskes I wonder if @jdconrad can help here

@jdconrad
Copy link
Contributor

Just got back from vacation. Will take a look soon.

@jdconrad jdconrad self-assigned this Jun 26, 2018
@jdconrad
Copy link
Contributor

jdconrad commented Jun 27, 2018

@atorok Looks like Java 11 has changed the message for an ArrayIndexOutOfBoundsException from just the out of bound 6 index to Index 6 out of bounds for length 5 so the matcher for the test needs to be changed. Have you added a constant to test for Java 11 minimum already like we have for 8 and 9?

If so I believe it should be as simple as replacing the existing outOfBoundsExceptionMessageMatcher method in ArrayTests for Painless with the following:

    @Override
    protected Matcher<String> outOfBoundsExceptionMessageMatcher(int index, int size) {
        if (Constants.JRE_IS_MINIMUM_JAVA11) {
            return equalTo("Index " + Integer.toString(index) + " out of bounds for length " + Integer.toString(size));
        }
        return equalTo(Integer.toString(index));
    }

Let me know if that works or I can be of help in anyway. Thanks for catching this bug!

@jasontedor
Copy link
Member

@jdconrad The constants come from Lucene; in this case we can use

JavaVersion.current().compareTo(JavaVersion.parse("11"))

which uses our own code (from org.elasticsearch.bootstrap.JavaVersion).

@rjernst
Copy link
Member

rjernst commented Jun 27, 2018

Have you added a constant to test for Java 11 minimum already like we have for 8 and 9?

The Constants class you are referring to is in Lucene, and hasn't been updated. Unfortunately the parsed major/minor that Constants contains is private to the class, so you would need to parse the java.specification.version in this test yourself to check for java 11.

@rjernst
Copy link
Member

rjernst commented Jun 27, 2018

Or even better use JavaVersion that Jason mentioned. Sorry my comment got delayed in sending.

@jdconrad
Copy link
Contributor

Ah, apologies didn't realize that was from Lucene.

alpar-t added a commit to alpar-t/elasticsearch that referenced this issue Jun 28, 2018
alpar-t added a commit to alpar-t/elasticsearch that referenced this issue Jun 28, 2018
@alpar-t alpar-t closed this as completed in cf2295b Jul 5, 2018
alpar-t added a commit that referenced this issue Jul 5, 2018
* Upgrade bouncycastle

Required to fix
`bcprov-jdk15on-1.55.jar; invalid manifest format `
on jdk 11

* Downgrade bouncycastle to avoid invalid manifest

* Add checksum for new jars

* Update tika permissions for jdk 11

* Mute test failing on jdk 11

* Add JDK11 to CI

* Thread#stop(Throwable) was removed

http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-June/053536.html

* Disable failing tests #31456

* Temprorarily disable doc tests

To see if there are other failures on JDK11

* Only blacklist specific doc tests

* Disable only failing tests in ingest attachment plugin

* Mute failing HDFS tests #31498

* Mute failing lang-painless tests #31500

* Fix backwards compatability builds

Fix JAVA version to 10 for ES 6.3

* Add 6.x to bwx -> java10

* Prefix out and err from buildBwcVersion for readability

```
> Task :distribution:bwc:next-bugfix-snapshot:buildBwcVersion
  [bwc] :buildSrc:compileJava
  [bwc] WARNING: An illegal reflective access operation has occurred
  [bwc] WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/alpar/.gradle/wrapper/dists/gradle-4.5-all/cg9lyzfg3iwv6fa00os9gcgj4/gradle-4.5/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
  [bwc] WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
  [bwc] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  [bwc] WARNING: All illegal access operations will be denied in a future release
  [bwc] :buildSrc:compileGroovy
  [bwc] :buildSrc:writeVersionProperties
  [bwc] :buildSrc:processResources
  [bwc] :buildSrc:classes
  [bwc] :buildSrc:jar

```

* Also set RUNTIME_JAVA_HOME for bwcBuild

So that we can make sure it's not too new for the build to understand.

* Align bouncycastle dependency

* fix painles array tets

closes #31500

* Update jar checksums

* Keep 8/10 runtime/compile untill consensus builds on 11

* Only skip failing tests if running on Java 11

* Failures are dependent of compile java version not runtime

* Condition doc test exceptions on compiler java version as well

* Disable hdfs tests based on runtime java

* Set runtime java to minimum supported for bwc

* PR review

* Add comment with ticket for forbidden apis
@alpar-t alpar-t added the jdk11 label Jul 6, 2018
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure jdk11 Team:Delivery Meta label for Delivery team >test-failure Triaged test failures from CI
Projects
None yet
Development

No branches or pull requests

8 participants