RFR: 8364786: Test java/net/vthread/HttpALot.java intermittently fails - 24999 handled, expected 25000

Alan Bateman alanb at openjdk.org
Fri Aug 8 07:41:12 UTC 2025


On Fri, 8 Aug 2025 06:52:18 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this test-only change which proposes to fix an intermittent failure in that test? This addresses https://bugs.openjdk.org/browse/JDK-8364786.
> 
> As noted in that issue, the test fails because the main thread doesn't wait for the server side HttpHandler instances to return from the handle() method. There are 2 commits in this PR - one is general clean up and additional logging and the second one is the actual fix where we `close()` the server side `Executor` before asserting a counter state in the main thread. Closing the server side `Executor` waits till the HttpHandler instances return from their handle() method and thus prevents these intermittent test failures.
> 
> The reporter of the JBS issue has tested this proposed fix in their setup and the test no longer fails. I have also triggered a test repeat (and tier testing) for this change in our CI.

test/jdk/java/net/vthread/HttpALot.java line 36:

> 34: import java.util.concurrent.atomic.AtomicInteger;
> 35: import com.sun.net.httpserver.HttpServer;
> 36: import jdk.test.lib.net.URIBuilder;

Did you mean to move the imports? Just curious as I usually put the test description at the top to make it easy to find, I guess others prefer it after the imports.

test/jdk/java/net/vthread/HttpALot.java line 98:

> 96:         // go
> 97:         server.start();
> 98:         try (serverExecutor) {

This part looks good, as does checking that the task result is "Hello" as that adds more checking.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26686#discussion_r2262171408
PR Review Comment: https://git.openjdk.org/jdk/pull/26686#discussion_r2262178653


More information about the net-dev mailing list