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

8269373: some tests in jdk/tools/launcher/ fails on localized Windows platform #4594

Closed
wants to merge 5 commits into from

Conversation

@masyano
Copy link

@masyano masyano commented Jun 25, 2021

Hi all,

Could you please review the 8269373 bug fixes?

These tests call java.lang.ProcessBuilder in direct, so not used jtreg command option. To run non-localized tests, -Duser.language=en and -Duser.country=US options should be added in ProcessBuilder.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269373: some tests in jdk/tools/launcher/ fails on localized Windows platform

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4594/head:pull/4594
$ git checkout pull/4594

Update a local copy of the PR:
$ git checkout pull/4594
$ git pull https://git.openjdk.java.net/jdk pull/4594/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4594

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4594.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 25, 2021

👋 Welcome back myano! 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
Copy link

@openjdk openjdk bot commented Jun 25, 2021

@masyano The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@masyano masyano changed the title some tests in jdk/tools/launcher/ fails on localized Windows platform 8269373: some tests in jdk/tools/launcher/ fails on localized Windows platform Jun 25, 2021
@openjdk openjdk bot added the rfr label Jun 25, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 25, 2021

Copy link
Member

@naotoj naotoj left a comment

From a peek at the bug report, I could not find out the exact cause why they are failing. Have you figured it out?

As to the fix itself, I would rather avoid hardcoding en-US in the argument. Would that be replaced with the launching process' locale?

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 27, 2021

@masyano This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@masyano
Copy link
Author

@masyano masyano commented Aug 4, 2021

Sorry for late reply.

These tests compare the output of running the jar, and the correct answers to the output results are written in English. When these are run on localized Windows platform, the output will be in the local language and the comparison result will be false. So, these need to add -Duser.language=en and -Duser.country=US to the execution option of the jar.

And I fixed to avoid hardcoding by using "test.vm.opts". If we want to run these tests on localized Windows platform, we need to add -Duser.language=en and -Duser.country=US as jtreg command options.

@naotoj
Copy link
Member

@naotoj naotoj commented Aug 4, 2021

Then I would think the better fix would be to run the test if the default locale is Locale.US, otherwise the test should exit gracefully.

@masyano
Copy link
Author

@masyano masyano commented Aug 19, 2021

It is true that some other tests say Passed if the locale is not US, but I rather think that is not a good way. I think we should run tests as much as possible to ensure quality even in non-US environments.

@naotoj
Copy link
Member

@naotoj naotoj commented Aug 23, 2021

IMHO, this kind of test that sets the locale forcefully sometimes gives us false positives. I'd rather eliminate that possibility than run tests in different locales

@masyano
Copy link
Author

@masyano masyano commented Aug 26, 2021

I think the current tests force the US locale, and false positives are test failures in non-US locale environments. This fix does not change the test results in the US locale, but allows it to work in non-US locale environments.

I can't think of a false positive problem with this fix, but what specific cases do you think are the problems?

@naotoj
Copy link
Member

@naotoj naotoj commented Aug 26, 2021

I think implicitly expecting locales to be set to en-US by specifying test.vm.opts is fragile which would introduce test instability.
In fact, looking at some of the tests, e.g., HelpFlagsTest at line 332, the intention is to silently exit in case it is not English. I think it is what the test is intended and it is a bug if it fails with other locales.

@openjdk
Copy link

@openjdk openjdk bot commented Sep 7, 2021

@masyano this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout 8269373
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot removed the merge-conflict label Sep 7, 2021
@masyano
Copy link
Author

@masyano masyano commented Sep 7, 2021

I fixed it to exit silently in case the locale is not US. Thank you.

naotoj
naotoj approved these changes Sep 7, 2021
Copy link
Member

@naotoj naotoj left a comment

Thanks. Looks good to me.

@openjdk
Copy link

@openjdk openjdk bot commented Sep 7, 2021

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

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

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

8269373: some tests in jdk/tools/launcher/ fails on localized Windows platform

Reviewed-by: naoto

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 12 new commits pushed to the master branch:

  • 1513dc7: 8271603: Unnecessary Vector usage in java.desktop
  • ea4907a: 8273047: test jfr/api/consumer/TestRecordedFrame.java timing out
  • 4eacdb3: 8273104: Refactoring option parser for UL
  • 8884d2f: 8273462: ProblemList vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java in -Xcomp mode
  • d6d6c06: 8273246: Amend the test java/nio/channels/DatagramChannel/ManySourcesAndTargets.java to execute in othervm mode
  • 708407e: 8273168: Remove superfluous use of boxing in java.desktop
  • 270a9d9: 8273043: [TEST_BUG] Automate NimbusJTreeSelTextColor.java
  • df05b4d: 8271923: [macos] the text color on the selected disabled tabbed pane button remains white making text unreadable
  • 2abf3b3: 8271340: Crash PhaseIdealLoop::clone_outer_loop
  • 99fb12c: 8271341: Opcode() != Op_If && Opcode() != Op_RangeCheck) || outcnt() == 2 assert failure with Test7179138_1.java
  • ... and 2 more: https://git.openjdk.java.net/jdk/compare/70157c78a838126bb29c91a410d9158763bfa2ad...master

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 (@naotoj) 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 label Sep 7, 2021
@masyano
Copy link
Author

@masyano masyano commented Sep 8, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Sep 8, 2021

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

@openjdk openjdk bot added the sponsor label Sep 8, 2021
@naotoj
Copy link
Member

@naotoj naotoj commented Sep 8, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Sep 8, 2021

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

  • 7e662e7: 8272413: Incorrect num of element count calculation for vector cast
  • f2f8136: 8265443: IGV: disambiguate groups by emiting additional properties
  • 59c9f75: 8273375: Remove redundant 'new String' calls after concatenation in java.desktop
  • faa942c: 8273000: Remove WeakReference-based class initialisation barrier implementation
  • 21012f2: 8078641: MethodHandle.asTypeCache can retain classes from unloading
  • 1855574: 8273038: ChannelInputStream.transferTo() uses FileChannel.transferTo(FileChannel)
  • 6750c34: 8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS
  • a66629a: 8254167: G1: Record regions where evacuation failed to provide targeted iteration
  • 286a1f6: 8273440: Zero: Disable runtime/Unsafe/InternalErrorTest.java
  • 7d24a33: 8273318: Some containers/docker/TestJFREvents.java configs are running out of memory
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/70157c78a838126bb29c91a410d9158763bfa2ad...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 8, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 8, 2021

@naotoj @masyano Pushed as commit cb112af.

💡 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
2 participants