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

8297141: Fix hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java for 8u #181

Closed

Conversation

zzambers
Copy link
Contributor

@zzambers zzambers commented Nov 16, 2022

Following test (from hotspot/tier1) currently fails on Windows x86:
hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java

Test output:

...
 stdout: [];
 stderr: [openjdk version "1.8.0_362-internal"
OpenJDK Runtime Environment (build 1.8.0_362-internal-zzambers-54a485c13e59fa68ea9dc088f320520eedbe33fe-b00)
OpenJDK Server VM (build 25.362-b00, mixed mode)
]
 exitValue = 0

java.lang.RuntimeException: 'UseSharedSpaces:' missing from stdout/stderr 

	at com.oracle.java.testlibrary.OutputAnalyzer.shouldContain(OutputAnalyzer.java:134)
	at DefaultUseWithClient.main(DefaultUseWithClient.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.lang.Thread.run(Thread.java:750)
...

Problem:
Test is Windows 32-bit only, only applies to Client VM and checks default behaviour of shared archive feature. Problem is, that default build of 32-bit windows JDK does not include Client VM, so Server VM is used (so -client arg does nothing). With Server VM tests fails. I tried to make build which has Client VM and then this test passes (It breaks other tests which expect default to be Server VM though).

Fix:
Test runs java with -version argument, which can print something similar to:

openjdk version "1.8.0_362-internal"
OpenJDK Runtime Environment (build 1.8.0_362-internal-zzambers-2bbffac3199782df1f9b81867fdfeb3d72889fcd-b00)
OpenJDK Client VM (build 25.362-b00, mixed mode)

This output can be used to check if Client VM and skip other checks, if Client VM is not used. Fix is JDK 8 only as test has been removed on newer JDKs by JDK-8154204 by [2]. But I decided to fix it for JDK 8.

Testing:
With this change test passes on Windows 32-bit. (both with Server [3] and Client [4] Vms)

[1] https://github.com/zzambers/jdk8u-dev/actions/runs/3438556844
[2] https://bugs.openjdk.org/browse/JDK-8154204
[3] https://github.com/zzambers/jdk8u-dev/actions/runs/3462926725
[4] https://github.com/zzambers/jdk8u-dev/actions/runs/3462887672


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8297141: Fix hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java for 8u

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev pull/181/head:pull/181
$ git checkout pull/181

Update a local copy of the PR:
$ git checkout pull/181
$ git pull https://git.openjdk.org/jdk8u-dev pull/181/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 181

View PR using the GUI difftool:
$ git pr show -t 181

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/181.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 16, 2022

👋 Welcome back zzambers! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 16, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 16, 2022

Webrevs

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

Shouldn't we just amend the condition on lines 41-45 to something like:

boolean is32BitWindowsClientVm = (Platform.isWindows() && Platform.is32bit() && Platform.isClient());
if (!is32BitWindowsClientVm) {
    System.out.println("Test only applicable on 32-bit Windows Client VM. Skipping");
    return;
}

@zzambers
Copy link
Contributor Author

@jerboaa Oh, that is indeed cleaner. I have not checked Platform class and I did not know it is capable of that. I'll update my PR. Thanks

@zzambers
Copy link
Contributor Author

Even though, I should test that VM launched with "-client" uses Client VM (maybe case where it has Client VM but it is not default). I would then probably need to run test in othervm and with -client arg as well.

@zzambers
Copy link
Contributor Author

Updated detection code. Tested on both default build [5] (without Client VM) and build with Client VM [6] with windows-x86 testing enabled. Passed both.

[5] https://github.com/zzambers/jdk8u-dev/actions/runs/3482764139
[6] https://github.com/zzambers/jdk8u-dev/actions/runs/3483679375

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

@openjdk
Copy link

openjdk bot commented Nov 22, 2022

@zzambers This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8297141: Fix hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java for 8u

Reviewed-by: sgehwolf

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 5 new commits pushed to the master branch:

  • da0c382: 8241086: Test runtime/NMT/HugeArenaTracking.java is failing on 32bit Windows
  • 91d8b89: 8129827: [TEST_BUG] Test java/awt/Robot/RobotWheelTest/RobotWheelTest.java fails
  • 9cb8752: 8079255: [TEST_BUG] [macosx] Test closed/java/awt/Robot/RobotWheelTest/RobotWheelTest fails for Mac only
  • b98d485: 8197859: VS2017 Complains about UINTPTR_MAX definition in globalDefinitions_VisCPP.hpp
  • 7ae002c: 8286582: Build fails on macos aarch64 when using --with-zlib=bundled

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jerboaa) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 22, 2022
@zzambers
Copy link
Contributor Author

@jerboaa Thanks for the review

(but still needs jdk8u-fix-yes)

@zzambers
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 22, 2022
@openjdk
Copy link

openjdk bot commented Nov 22, 2022

@zzambers
Your change (at version e95b956) is now ready to be sponsored by a Committer.

@jerboaa
Copy link
Contributor

jerboaa commented Nov 22, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 22, 2022

Going to push as commit 5a32484.
Since your change was applied there have been 5 commits pushed to the master branch:

  • da0c382: 8241086: Test runtime/NMT/HugeArenaTracking.java is failing on 32bit Windows
  • 91d8b89: 8129827: [TEST_BUG] Test java/awt/Robot/RobotWheelTest/RobotWheelTest.java fails
  • 9cb8752: 8079255: [TEST_BUG] [macosx] Test closed/java/awt/Robot/RobotWheelTest/RobotWheelTest fails for Mac only
  • b98d485: 8197859: VS2017 Complains about UINTPTR_MAX definition in globalDefinitions_VisCPP.hpp
  • 7ae002c: 8286582: Build fails on macos aarch64 when using --with-zlib=bundled

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 22, 2022
@openjdk openjdk bot closed this Nov 22, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 22, 2022
@openjdk
Copy link

openjdk bot commented Nov 22, 2022

@jerboaa @zzambers Pushed as commit 5a32484.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
2 participants