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

8297091: New langtools test jdk/javadoc/doclet/testValueTag/TestValueFormats.java fails on machines with unexpected number format #11177

Closed
wants to merge 1 commit into from

Conversation

RealCLanger
Copy link
Contributor

@RealCLanger RealCLanger commented Nov 15, 2022

The new test langtools/jdk/javadoc/doclet/testValueTag/TestValueFormats.java assumes a number format with a decimal separator dot (.). This can be different in other locales.

This fixes the issue by expecting a number format that is calculated at runtime, with the locale settings the test runs in. Not sure if it is the correct way to fix, though.


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-8297091: New langtools test jdk/javadoc/doclet/testValueTag/TestValueFormats.java fails on machines with unexpected number format

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11177/head:pull/11177
$ git checkout pull/11177

Update a local copy of the PR:
$ git checkout pull/11177
$ git pull https://git.openjdk.org/jdk pull/11177/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11177

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11177.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 15, 2022

👋 Welcome back clanger! 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 changed the title JDK-8297091 8297091: New langtools test jdk/javadoc/doclet/testValueTag/TestValueFormats.java fails on machines with unexpected number format Nov 15, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 15, 2022
@openjdk
Copy link

openjdk bot commented Nov 15, 2022

@RealCLanger The following label will be automatically applied to this pull request:

  • javadoc

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

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.org label Nov 15, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 15, 2022

Webrevs

@pavelrappo
Copy link
Member

Thanks for reporting the bug and providing the fix. The fix looks simple and clean. We need to specify which locale is used by the {@value} tag when it formats the value, in "Documentation Comment Specification for the Standard Doclet".

@jonathan-gibbons
Copy link
Contributor

Generally, there are two ways to fix issues like this:

  1. force the locale to be as needed
  2. accommodate the locale being used

1 is simpler; 2 seems like a better solution.

In general, we don't do a lot of testing in non-English locales. (Our bad.). Is this the only (javadoc?) test that fails?

Copy link
Member

@pavelrappo pavelrappo left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Nov 16, 2022

@RealCLanger 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:

8297091: New langtools test jdk/javadoc/doclet/testValueTag/TestValueFormats.java fails on machines with unexpected number format

Reviewed-by: prappo, jjg

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

  • 0ac5b55: 8297349: Parallel: Use correct claim value for CLD oop iteration in PSScavengeCLDClosure
  • 932bf35: 8297333: Parallel: Remove unused methods in PCIterateMarkAndPushClosure
  • 42c2037: 8297382: Test fails to compile after JDK-8288047
  • 6d6046b: 8252713: jtreg time out of CtrlASCII.java seems to hang the Xserver.
  • 88957a7: 8297147: UnexpectedSourceImageSize test times out on slow machines when fastdebug is used
  • 0696854: 8297299: SequenceInputStream should not use Vector
  • f0e99c6: 8297301: Cleanup unused methods in JavaUtilJarAccess
  • 392ac70: 8297211: Expensive fillInStackTrace operation in HttpURLConnection.getOutputStream0 when no content-length in response
  • 5a45c25: 8297164: Update troff man pages and CheckManPageOptions.java
  • f12710e: 8288047: Accelerate Poly1305 on x86_64 using AVX512 instructions
  • ... and 117 more: https://git.openjdk.org/jdk/compare/0cbf084b44cbae1b879f4dd7847de0a551e5c1ea...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

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

Generally, there are two ways to fix issues like this:

  1. force the locale to be as needed
  2. accommodate the locale being used

1 is simpler; 2 seems like a better solution.

Not sure I understand correctly - Option 1 would mean that a locale can be picked by some setting and Option 2 means the current behavior - use the system locale, right? But how would option 1 then be simpler than option 2, given that I perceive option 2 as current status quo? 😄

However, with option 2, I guess my proposed testfix would be the right thing to do, correct?

In general, we don't do a lot of testing in non-English locales. (Our bad.). Is this the only (javadoc?) test that fails?

I'm only aware of this one ATM.

@pavelrappo
Copy link
Member

pavelrappo commented Nov 17, 2022

Generally, there are two ways to fix issues like this:

  1. force the locale to be as needed
  2. accommodate the locale being used

1 is simpler; 2 seems like a better solution.

Not sure I understand correctly - Option 1 would mean that a locale can be picked by some setting and Option 2 means the current behavior - use the system locale, right? But how would option 1 then be simpler than option 2, given that I perceive option 2 as current status quo? 😄

However, with option 2, I guess my proposed testfix would be the right thing to do, correct?

In general, we don't do a lot of testing in non-English locales. (Our bad.). Is this the only (javadoc?) test that fails?

I'm only aware of this one ATM.

My take is that Option (1) is "golden output". You fixate the locale and capture the output. Then every run you force that same locale (yes, there's a javadoc option called -locale) and compare the output of the run with the golden output.

Option (2) is "property testing". You assert some property of the system. In this case, the property, albeit a bit implicit, looks something like this:

whatever locale is effective for this javadoc run, is used by `@value` to format its arguments

Your test additionally assumes that "if no locale is specified, the default locale is used". Which is true.

@RealCLanger
Copy link
Contributor Author

So this PR is good as is?

@jonathan-gibbons
Copy link
Contributor

@RealCLanger yes, you're good to go.

The next step is for you to enter /integrate as a comment.

@RealCLanger
Copy link
Contributor Author

@RealCLanger yes, you're good to go.

The next step is for you to enter /integrate as a comment.

Thanks, @jonathan-gibbons, for approving. Technically I know what to do to get this merged. I just wasn't sure whether you were ok with the fix or suggesting something different. So...

/integrate

@openjdk
Copy link

openjdk bot commented Nov 22, 2022

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

  • b6dddf4: 8239801: [macos] java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java fails
  • 260e4dc: 8295011: EC point multiplication improvement for secp256r1
  • fb6c992: 8296957: One more cast in SAFE_SIZE_NEW_ARRAY2
  • ccc6e16: 8291067: macOS should use O_CLOEXEC instead of FD_CLOEXEC
  • 0ac5b55: 8297349: Parallel: Use correct claim value for CLD oop iteration in PSScavengeCLDClosure
  • 932bf35: 8297333: Parallel: Remove unused methods in PCIterateMarkAndPushClosure
  • 42c2037: 8297382: Test fails to compile after JDK-8288047
  • 6d6046b: 8252713: jtreg time out of CtrlASCII.java seems to hang the Xserver.
  • 88957a7: 8297147: UnexpectedSourceImageSize test times out on slow machines when fastdebug is used
  • 0696854: 8297299: SequenceInputStream should not use Vector
  • ... and 121 more: https://git.openjdk.org/jdk/compare/0cbf084b44cbae1b879f4dd7847de0a551e5c1ea...master

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 labels Nov 22, 2022
@RealCLanger RealCLanger deleted the testvalueformats branch November 22, 2022 21:00
@openjdk
Copy link

openjdk bot commented Nov 22, 2022

@RealCLanger Pushed as commit 4a544bb.

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

@jonathan-gibbons
Copy link
Contributor

@RealCLanger yes, you're good to go.
The next step is for you to enter /integrate as a comment.

Thanks, @jonathan-gibbons, for approving. Technically I know what to do to get this merged. I just wasn't sure whether you were ok with the fix or suggesting something different. So...

/integrate

Yeah, I was just commenting on the possible approaches to an issue like this.

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 javadoc javadoc-dev@openjdk.org
3 participants