-
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
8304174: Remove delays from httpserver tests #13028
Conversation
👋 Welcome back djelinski! A progress list of the required criteria for merging this PR into |
@djelinski The following label will be automatically applied to this pull request:
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. |
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.
Hello Daniel, the changes look good to me. Like you note, I don't see any of these tests relying on the delay of server stop()
for their tests. It's a bit surprising that a lot of these tests were using those delays, but I guess that's because one test influencing the code in another test.
That's a good improvement. |
@djelinski 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 56 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. ➡️ To integrate this PR with the above commit message to the |
From my observations, typically these delays have been used to provide a level of synchronicity between the main thread and various background processing threads. Thus, allowing background processing to conclude prior to the actual shutdown in the server. For example, if you analyse the HttpServerTest, there exists some potential for race conditions to occur. An influencing factor, in all this, is the load on the test system and the number of threads executing. With these changes there may be some intermittent failures -- so one to watch !! |
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.
A better solution might be to revisit HttpServer::stop. That would involve implementing proper exchange ref counting, with a guarantee that the ref count can't be transiently observed as 0 after a new request has been accepted and before it is actually handled - which may not be easy. I suspect the current strategy of waiting a couple of seconds might have hidden a number of potential shutdown races. Though if you can verify that your proposed change doesn't actually introduce any intermittent failures (as Mark is worried about) I would have no objection.
Thanks for your comments! I plan to revisit |
50 repeats of tests using SimpleHttpServer also passed. Removing the delays appears to have no effect on test stability. |
/integrate |
Going to push as commit 4505670.
Your commit was automatically rebased without conflicts. |
@djelinski Pushed as commit 4505670. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This change improves the running time of many httpserver tests; it removes the one second delay introduced by
delay()
calls, and performs immediate httpserver stop by callingstop(0)
.For example,
com/sun/net/httpserver/Test1.java
usually takes 20-30 seconds without this change; with this change it completes in 5-8 seconds.Tiers 1-3 still green.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/13028/head:pull/13028
$ git checkout pull/13028
Update a local copy of the PR:
$ git checkout pull/13028
$ git pull https://git.openjdk.org/jdk pull/13028/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13028
View PR using the GUI difftool:
$ git pr show -t 13028
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13028.diff