On Mon, 20 Oct 2025 16:47:50 GMT, Daniel Fuchs <[email protected]> wrote:

>> The second temporal constraint is something that could possibly fail. If it 
>> fails why is it considered a test failure?
>> 
>> Consider a slightly convoluted scenario for shouldCompeteAfterDelay (the 
>> test which fails):
>> 
>> The Exchange will activate after 1 second. That thread is scheduled to 
>> execute but remains RTR due to excessive load on the system
>> The server.stop is invoked with a 20 second delay, indicating this is the 
>> max allowed time for graceful shutdown i.e. the time in which any extant
>> exchanges should complete. If that timeout expires in the finishLatch.await 
>> returns — no check is made to determine if this was a timeout expiry or not —
>> then the server proceeds to shutdown.
>> 
>> Thus, in this scenario, the test will fail. As such, how is this a failure? 
>> Your test has placed a temporal condition which has a possibility of not 
>> being met.
>> Your expectation is that because the shutdown delay is 20 seconds the test 
>> should always pass, with the Exchange having completed, as such 
>> deterministic. This
>> is not unreasonable, but it is not a condition that can be 100% met, and is 
>> not deterministic.
>> 
>> The semantics of server.stop doesn’t consider a delay timeout as an error 
>> condition, so why is this the case in the test.
>> So rather than it being a test failure, should a delay expiry just be 
>> observational ?
>
> Was that a comment for  the other test @msheppar  - there's no 20s here.
> I still think a better impl would be to call completeExchange() after 
> timeShutdown() here since we want to verify that the server will stop after 
> the 1s delay even if an exchange is in progress.

it's shouldCompeteAfterDelay  the test that fails

  final Duration delayDuration = Duration.ofSeconds(Utils.adjustTimeout(20));
        log("Shutdown triggered with the delay of " + 
delayDuration.getSeconds());
        final long elapsed = timeShutdown(delayDuration, startTime);
        log("Shutdown complete");

the shutdown delay has been increased to 20 seconds

you are verifying that the server will stop after a max time of 20 seconds + 
(whatever time its takes to terminate whatever needs. to be terminated)

The 1 seconds delay is to activate the Exchange and set it running

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27670#discussion_r2445683520

Reply via email to