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

Fix Jpms test #28726

Merged
merged 3 commits into from
Sep 29, 2023
Merged

Fix Jpms test #28726

merged 3 commits into from
Sep 29, 2023

Conversation

Abacn
Copy link
Contributor

@Abacn Abacn commented Sep 28, 2023

Fixes #28724

Two issues

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@Abacn
Copy link
Contributor Author

Abacn commented Sep 28, 2023

Run Jpms Direct Java 17 PostCommit

@Abacn
Copy link
Contributor Author

Abacn commented Sep 28, 2023

Example run on fork: https://github.com/Abacn/beam/actions/runs/6342390089/job/17228019422 the test runs (though failing due to gcs credential not exist in fork). On beam repo currently test jar fails to compile

@Abacn
Copy link
Contributor Author

Abacn commented Sep 28, 2023

R: @magicgoody @damccorm

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@Abacn
Copy link
Contributor Author

Abacn commented Sep 28, 2023

Run Jpms Direct Java 17 PostCommit

Jenkins phrase trigger not working though

@Abacn
Copy link
Contributor Author

Abacn commented Sep 29, 2023

Run Jpms Direct Java 17 PostCommit

@Abacn
Copy link
Contributor Author

Abacn commented Sep 29, 2023

Run Jpms Direct Java 11 PostCommit

@github-actions github-actions bot removed the build label Sep 29, 2023
@Abacn
Copy link
Contributor Author

Abacn commented Sep 29, 2023

Run Jpms Direct Java 11 PostCommit

both Jenkins and github action (https://github.com/apache/beam/actions/runs/6345867305) passed

@Abacn
Copy link
Contributor Author

Abacn commented Sep 29, 2023

Run Jpms Direct Java 17 PostCommit

both Jenkins and github action (https://github.com/apache/beam/actions/runs/6345584729) passed

if (project.hasProperty("compileAndRunTestsWithJava17")) {
javaVersion = '1.17'
} else {
javaVersion = '1.11'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is subtle. Current Java11/Java17 test are configured differently.

  • Java11 passed -Dorg.gradle.java.home=$JAVA_HOME_11_X64 so all projects (e.g. java core) are also compared with Java11

  • Java17 uses compileAndRunTestsWithJava17 flag so all but this project are compiled with default JDK (Java8)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future TODO: maybe just have a testJavaVersion separate from beamJavaVersion rather than a boolean with a giant name that sounds more complicated than it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, noted in #28120 (comment) will be done as part of Java 21 support

def java17Home = project.findProperty("java17Home")
project.tasks.withType(JavaCompile) {
// direct compileJava to use specified java version.
project.tasks.compileJava {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes both (default JDK is Java9+) and (default JDK is Java8 and pass java11Home or java17Home) works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK to me if it works. Do you need setJava11Options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have setJava11Options or correspondents in beamModulePlugin

setJava17Options is due to new module export rules needed in Java17 (https://blogs.oracle.com/javamagazine/post/a-peek-into-java-17-continuing-the-drive-to-encapsulate-the-java-runtime-internals), it does the same thing as the current code (removed/simplified in this PR).

@Abacn
Copy link
Contributor Author

Abacn commented Sep 29, 2023

Ready for review now. PTAL @damccorm @kennknowles

@damccorm
Copy link
Contributor

I don't think I understand the current or desired test behavior here well enough to review without doing some more research, so I will defer to @kennknowles for review

Copy link
Member

@kennknowles kennknowles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this does what we want. Anyhow I think I have as much confidence after this change as I had before it :-)

if (project.hasProperty("compileAndRunTestsWithJava17")) {
javaVersion = '1.17'
} else {
javaVersion = '1.11'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future TODO: maybe just have a testJavaVersion separate from beamJavaVersion rather than a boolean with a giant name that sounds more complicated than it is.

def java17Home = project.findProperty("java17Home")
project.tasks.withType(JavaCompile) {
// direct compileJava to use specified java version.
project.tasks.compileJava {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK to me if it works. Do you need setJava11Options?

@kennknowles
Copy link
Member

I restarted the failed job, which seems to have failed to upload the cache. Seems there may be concurrency errors in Gradle caching. Not sure if that is GHA related or just Gradle remote cache generally.

@Abacn
Copy link
Contributor Author

Abacn commented Sep 29, 2023

thanks, now all tests passed (the one in checks and github action postcommits - commented above)

@Abacn Abacn merged commit 75d7c70 into apache:master Sep 29, 2023
20 checks passed
@Abacn Abacn deleted the fixjpmstest branch October 6, 2023 02:12
@Abacn Abacn mentioned this pull request Oct 6, 2023
3 tasks
kennknowles pushed a commit to kennknowles/beam that referenced this pull request Oct 6, 2023
* Fix Jpms test

* Configure main src also compile in specified Java ver

* Fix Java11 case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Failing Test]: beam_PostCommit_Java_Jpms on Java17 permared
3 participants