-
Notifications
You must be signed in to change notification settings - Fork 596
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
Build and test on Java 11 #6119
Conversation
The goal of this PR is to investigate if what needs doing to compile GATK and run its tests on Java 11. Some notes:
The vast majority of tests are passing on Java 11, the following are failing:
|
Using the latest version of ADAM (which has a Scala 2.12 version) fixes the 2bit failures. I also added a fix for the |
As a side note, htsjdk could have 2bit support soon: samtools/htsjdk#1417 |
Unit and integration tests are now all passing on openjdk11. The build does not however work on Java 8, since the javadoc compilation has been commented out. This will need to be made conditional on the Java version. |
I've now fixed this PR to build on Java 8 as usual. For Java 11 testing, I've suppressed the warnings for using the com.sun.javadoc classes (they are still available in Java 11, it's just that they are deprecated - or actually marked for removal). Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomwhite Some comments here. I'm not certain we're actually building/running tests on 11 since I think we're doing so in the java 8 docker.
"The ClassLoader obtained from the Java ToolProvider is null. " | ||
+ "A Java $requiredJavaVersion JDK must be installed. $buildPrerequisitesMessage") | ||
} | ||
def ensureBuildPrerequisites(largeResourcesFolder, buildPrerequisitesMessage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need some sort of test here because this also catches people who are running with a java 8 JRE instead of a JDK. It looks like gradle can tell you the version using JavaVersion.current()
and we can still have this test in the case of java 8. We could throw a clear error message for lower versions, and a warning for versions 9/10/ 12+ that it's not tested on those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've updated the PR to do what you suggest.
.travis.yml
Outdated
env: TEST_TYPE=integration TEST_VERBOSITY=minimal TEST_REQUIRE_GCLOUD=true | ||
env: SCALA_VERSION=2.11 TEST_TYPE=integration TEST_VERBOSITY=minimal TEST_REQUIRE_GCLOUD=true | ||
- jdk: openjdk11 | ||
env: SCALA_VERSION=2.12 TEST_TYPE=integration TEST_DOCKER=true TEST_VERBOSITY=minimal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this isn't actually running the tests under java 11. The docker runs on java 8, so I think the travis machine is java 11, but the actual tests are under java 8. Fixing that might be complicated. I think we would essentially have to build 2 different base images and then parameterize the docker file to take one or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would removing the TEST_DOCKER=true
help? This would then be like the oraclejdk8
entry in the matrix.
@@ -142,7 +144,7 @@ public ByteBuffer getBuf() throws ExecutionException, InterruptedException { | |||
|
|||
public WorkUnit resetForIndex(long blockIndex) { | |||
this.blockIndex = blockIndex; | |||
buf.clear(); | |||
((Buffer) buf).clear(); // for Java 11, see https://github.com/jruby/jruby/issues/5450 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a more specific comment here as well would be useful. Also, is it possible to leave this out if we run javac with the -release 8 command? It looks like that will cause it to build using java 8 library descriptions so that it can run on 8, which we should probably be doing anyway if we're supporting both.
@@ -155,7 +155,7 @@ void loadRandomLongsTest() { | |||
for (int valNo = 0; valNo != HHASH_NVALS; ++valNo) { | |||
final long randLong = randomLong(rng); | |||
hopscotchSet.add(randLong); | |||
hashSet.add(new Long(randLong)); | |||
hashSet.add(Long.valueOf(randLong)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably just rely on autoboxing in most of these places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed these in #6145.
bb6d926
to
cd5d596
Compare
It looks like we need to update mockito.
|
3.0.0 seems to be the most recent version available in maven. Hopefully it knows about java 11? |
@lbergelson I updated to the latest 2.x Mockito and that fixed the problem. The only failing test now is FuncotatorIntegrationTest#nonTrivialLargeDataValidationTest. The output VCF differs in the
not
It looks like it could be a case of using HashSet not LinkedHashSet, or HashMap not LinkedHashMap - but a quick replace throughout the GATK and HTSJDK codebase didn’t fix the problem. |
This is exactly the sort of nightmare bug we get every java update. Just 1 isn't bad at all. I'm surprised replacing all the hashsets didn't work. It could come down to inadequate tiebreaking in a sort which falls back to identityHash. We saw that in a different bug recently. I'll take a look. |
Interesting, when I run locally I get:
|
Ok. It turns out I was hitting adoptium/temurin-build#1211. Reverting to java 11.0.3 resolves that and now I get the same error you see. |
That was a good use of my morning :( |
I found a pretty nasty funcotator bug as part of looking into this test failure. I think we will need to patch that as a separate pr. |
I can confirm that the fix in #6178 resolves the last failing test here for Java 11. Thanks @lbergelson. (The reason my bulk change to LinkedHashSet/Map didn't work was because it missed |
This reverts commit 15d6a63.
… Java 11 due a Spark error that is not fixed until Spark 3.
@lbergelson this is now passing thanks to your Funcotator fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks like we have beta support for java 11...
Investigate the changes needed to run on Java 11.