Skip to content

Commit da77015

Browse files
committed
removed unneeded thread for exchange completion in shouldCompleteAfterDelay
1 parent 7dd7cc8 commit da77015

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

test/jdk/com/sun/net/httpserver/ServerStopTerminationTest.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,8 @@ public void shouldCompleteAfterDelay() throws InterruptedException {
166166
log("Shutdown triggered with the delay of " + delayDuration.getSeconds());
167167
final long elapsed = timeShutdown(delayDuration);
168168
log("Shutdown complete");
169-
170-
// Complete the exchange 10 second into the future.
171-
// Runs in parallel, so won't block the server stop
172-
final Duration exchangeDuration = Duration.ofSeconds(Utils.adjustTimeout(10));
173-
// taking start time before entering completeExchange to account for possible
174-
// delays in reaching server.stop().
175-
completeExchange(exchangeDuration);
176-
log("Complete Exchange triggered");
177-
178-
// The shutdown should not await the exchange to complete
179-
if (elapsed >= exchangeDuration.toNanos()) {
180-
fail("HttpServer.stop terminated too late");
181-
}
169+
complete.countDown();
170+
log("Exchange completed");
182171

183172
// The shutdown delay should have expired
184173
if (elapsed < delayDuration.toNanos()) {

0 commit comments

Comments
 (0)