On Mon, 3 Nov 2025 14:20:29 GMT, serhiysachkov <[email protected]> wrote:

>> test/jdk/com/sun/net/httpserver/Test9.java line 126:
>> 
>>> 124:                 executor.shutdown ();
>>> 125:             Files.delete(smallFilePath);
>>> 126:             Files.delete(largeFilePath);
>> 
>> Wouldn't it be better to have the test wait until the HttpsServer have 
>> stopped and the executor has terminated?
>
> The test used 2 approaches here: deleteOnExit() and explicit delete, so my 
> idea here to align behaviour to use single approach that will delete files, 
> plus the stop method timeout was updated from 2 to 0 couple commits ago, so 
> wasn't sure if it's good idea to pop it up again.

We could simply let `jtreg` do the deletion. We run these tests in `/othervm` 
so `deleteOnExit()` is a possibility.
Alternative would be to call `stop(Integer.MAX_VALUE)` and `executor.close()` - 
but then we'd need to be sure the the fixes to `HttpServer::stop` have been 
backported wherever this fix will be backported.
If `deleteOnExit()` solves the issue I'm OK with it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28108#discussion_r2486924508

Reply via email to