Skip to content

[CI] NamingConventionsTaskIT fails assertion about test naming #31665

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

Closed
polyfractal opened this issue Jun 28, 2018 · 4 comments · Fixed by #31681
Closed

[CI] NamingConventionsTaskIT fails assertion about test naming #31665

polyfractal opened this issue Jun 28, 2018 · 4 comments · Fixed by #31681
Assignees
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team >test-failure Triaged test failures from CI

Comments

@polyfractal
Copy link
Contributor

NamingConventionsTaskIT has been failing on two tests: testNameCheckFailsAsItShould and testNameCheckFailsAsItShouldWithMain.

@atorok is working on it, just opening this issue to keep track of the awaitsFix.

Most recent failure: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+intake/2220/console

java.lang.AssertionError: expected:  'Classes ending with [Tests] or [IT] or extending [UnitTestCase] must be in src/test/java:' but it was not found in the output
	at __randomizedtesting.SeedInfo.seed([BF170365C0072BBC:9223A5975F0FE26A]:0)
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.elasticsearch.gradle.precommit.NamingConventionsTaskIT.testNameCheckFailsAsItShouldWithMain(NamingConventionsTaskIT.java:65)
	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:564)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1713)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:907)
	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 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$2.evaluate(ThreadLeakControl.java:404)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:678)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.access$200(RandomizedRunner.java:140)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:598)
java.lang.AssertionError: expected:  'Found inner classes that are tests, which are excluded from the test runner:' but it was not found in the output
	at __randomizedtesting.SeedInfo.seed([BF170365C0072BBC:9135BE74FA9DCEBA]:0)
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.elasticsearch.gradle.precommit.NamingConventionsTaskIT.testNameCheckFailsAsItShould(NamingConventionsTaskIT.java:40)
	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:564)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1713)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:907)
	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 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$2.evaluate(ThreadLeakControl.java:404)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:678)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.access$200(RandomizedRunner.java:140)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:598)
@polyfractal polyfractal added :Delivery/Build Build or test infrastructure >test-failure Triaged test failures from CI labels Jun 28, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

polyfractal added a commit that referenced this issue Jun 28, 2018
Note: no awaitsFix available, so I fell back to JUnit @ignore

Tracking issue: #31665
polyfractal added a commit that referenced this issue Jun 28, 2018
Note: no awaitsFix available, so I fell back to JUnit @ignore

Tracking issue: #31665
@alpar-t
Copy link
Contributor

alpar-t commented Jun 29, 2018

I believe the test was in fact picking up a problem.
After it was ignored we got this failure:

00:14:56 > Task :qa:ccs-unavailable-clusters:namingConventions FAILED
00:14:56 
00:14:56 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/test/NamingConventionsCheck has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0
00:14:56 > Task :qa:ccs-unavailable-clusters:integTestCluster#stop
00:14:56 	at java.lang.ClassLoader.defineClass1(Native Method)
00:14:56 
00:14:56 	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
00:14:56 Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
00:14:56 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
00:14:56 See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings
00:14:56 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
00:14:56 223 actionable tasks: 222 executed, 1 up-to-date
00:14:56 	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
00:14:56 	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
00:14:56 	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
00:14:56 	at java.security.AccessController.doPrivileged(Native Method)
00:14:56 	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
00:14:56 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
00:14:56 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
00:14:56 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
00:14:56 	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)

@alpar-t
Copy link
Contributor

alpar-t commented Jun 29, 2018

I can reproduce this locally with export RUNTIME_JAVA_HOME=$JAVA8_HOME.
JAVA_HOME is jdk 10, so compile will also use 10.
That means that we'll try to run the newer class version on the older JVM, which won't work.
I know how to fix this, but I'm still struggling to understand why this broke with the change I did.

@alpar-t
Copy link
Contributor

alpar-t commented Jun 29, 2018

The root cause is that during the Java rewrite NamingConventionsCheck.class.getProtectionDomain().getCodeSource().getLocation().getPath() is how we find the class to execute, whereas before we used a dependency on the build tools project.
The lather does have source compatibility set via the build plugin, but the former does not.

nik9000 pushed a commit that referenced this issue Jun 29, 2018
Move min compiler and runtime version to files so we can fix the source
and target comparability of the build script to those

Closes #31665
nik9000 pushed a commit that referenced this issue Jun 29, 2018
Move min compiler and runtime version to files so we can fix the source
and target comparability of the build script to those

Closes #31665
@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 Team:Delivery Meta label for Delivery team >test-failure Triaged test failures from CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants