Skip to content

Conversation

@justin-curtis-lu
Copy link
Member

@justin-curtis-lu justin-curtis-lu commented Nov 20, 2025

JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts.
While the timeout factor is reverted, this test was testing too many inputs, and should be changed.
Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree.

The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.)

Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done.


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-8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28443

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 20, 2025

👋 Welcome back jlu! 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 bot commented Nov 20, 2025

@justin-curtis-lu 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:

8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out

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 48 new commits pushed to 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.

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

@openjdk openjdk bot changed the title JDK-8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out Nov 20, 2025
@openjdk
Copy link

openjdk bot commented Nov 20, 2025

@justin-curtis-lu The following labels will be automatically applied to this pull request:

  • core-libs
  • i18n

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.

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

mlbridge bot commented Nov 20, 2025

Webrevs

doTest(fmt, Long.valueOf(value));
// Return a random value from -range..+range.
private static double randomDouble(double range) {
double a = Math.random();
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest using jdk.test.lib.RandomFactory, as this supports reproducible values in case of a randomised test failure.

import jdk.test.lib.RandomFactory;
...
 * @library /test/lib
 * @build jdk.test.lib.RandomFactory
...
    private static final Random RANDOM = RandomFactory.getRandom();
...
    private static double randomDouble(double range) {
        double a = RANDOM.nextDouble();
...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the improvement, updated in dca988e.

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

Good refactoring. One minor comment below

* @bug 4266589 8031145 8164791 8316696 8368001
* @summary NumberFormat round trip testing of parsing and formatting.
* This test checks 4 factory instances per locale against ~20 numeric inputs.
* Samples ~1/4 of the available locales from NumberFormat SPI.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: it is not using SPI

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs [email protected] i18n [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants