RFR: 8304174: Remove delays from httpserver tests

Daniel Fuchs dfuchs at openjdk.org
Wed Mar 15 15:55:50 UTC 2023


On Tue, 14 Mar 2023 19:41:25 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> 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 calling `stop(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.

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.

-------------

PR: https://git.openjdk.org/jdk/pull/13028


More information about the net-dev mailing list