-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8326718: Test java/util/Formatter/Padding.java should timeout on large inputs before fix in JDK-8299677 #18033
Conversation
…rge inputs before JDK-8299677
👋 Welcome back chadrako! A progress list of the required criteria for merging this PR into |
Webrevs
|
@@ -26,7 +26,7 @@ | |||
* @bug 4906370 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @bug 4906370 | |
* @bug 4906370 8299677 8326718 |
or maybe just
* @bug 4906370 | |
* @bug 4906370 8326718 |
@@ -26,7 +26,7 @@ | |||
* @bug 4906370 | |||
* @summary Tests to excercise padding on int and double values, | |||
* with various flag combinations. | |||
* @run junit Padding | |||
* @run junit/timeout=10 Padding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/timeout=10 looks problematic, I don't think you want that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue with this? Is there a different way to set a timeout? The test tests that format does not take a long time to run so I would like to have a timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue with this? Is there a different way to set a timeout? The test tests that format does not take a long time to run so I would like to have a timeout
Hard-coded timeout in a test are generally considered harmful as the test suite is run on a wide variety of systems, a single value could be too large for fast systems and too small for slow ones. The jtreg harness has an overall -timeout:N
factor which can scale up or down all the timeouts of individual tests. I don't know offhand if there is an existing idiom to do this with junit tests from within jtreg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed that timeout. Test fails before patch even when timeout factor is 10. Passes after patch within seconds. Default timeout should be good
I guess the title should read |
The test should timeout/fail before the fix in JDK-8299677 and pass after. I could update the title to be |
"8326718: Test java/util/Formatter/Padding.java does timeout on large inputs before fix in JDK-8299677" To me, |
The fix in JDK-8299677 serves it's intended purpose but the test added with it does not test that. The original test does not timeout before or after the fix which is the issue. "8326718: Test java/util/Formatter/Padding.java does not timeout on large inputs after JDK-8299677" Maybe a better title is |
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright nit: per OpenJDK conventions, the new copyright for the updated file should be "2023, 2024," not just "2024".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. | |
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. |
with a ,
after the 2nd year as well. Otherwise a check will fail, as I learned the hard-way ;-)
@chadrako The title of the issue should succinctly describe the problem at the time it is filed. |
Then I feel like the current title is correct. The issue at the time of filing is that I'm open to other's opinions on this as well |
@chadrako OK, I now get what you mean with the description in the title. Although it should be noted that the tests were introduced with JDK-8299677 and didn't exercise the large widths in the format specifications, so they could not timeout neither before nor after the fix as they were not tested. So maybe yes, your second proposal
sounds better. |
private static final String tenMillionZeros = "0".repeat(10000000); | ||
private static final String tenMillionBlanks = " ".repeat(10000000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit to help readability
private static final String tenMillionZeros = "0".repeat(10000000); | |
private static final String tenMillionBlanks = " ".repeat(10000000); | |
private static final String tenMillionZeros = "0".repeat(10_000_000); | |
private static final String tenMillionBlanks = " ".repeat(10_000_000); |
@chadrako 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:
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 120 new commits pushed to the
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 (@rgiulietti) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
/sponsor |
Going to push as commit 4f33608.
Your commit was automatically rebased without conflicts. |
@rgiulietti @chadrako Pushed as commit 4f33608. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
JDK-8299677 fixes a bug with Formatter.format taking a long time when there is a lot of padding. This test runs Formatter.format with very large padding. Test fails before JDK-8299677 and passes after.
Timeout for the test was set to 10 seconds. Test passes locally with as low as 1 (after JDK-8299677) and fails as high as 120 (before JDK-8299677) so it should be consistent.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18033/head:pull/18033
$ git checkout pull/18033
Update a local copy of the PR:
$ git checkout pull/18033
$ git pull https://git.openjdk.org/jdk.git pull/18033/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18033
View PR using the GUI difftool:
$ git pr show -t 18033
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18033.diff
Webrev
Link to Webrev Comment