Close route off the caller thread

- Complete the async route close on the worker executor so the cross-thread assertion no longer depends on whether the first stage finished before the handler was attached
This commit is contained in:
Brian Neumann-Fopiano
2026-09-08 04:28:40 -04:00
parent e5b7cb97a8
commit 9d22a18a3a
@@ -723,10 +723,10 @@ public final class GenerationHistoryRuntimeRouterTest {
assertThrows(IllegalStateException.class, route::close); assertThrows(IllegalStateException.class, route::close);
} }
}, executor); }, executor);
CompletableFuture<Void> completion = work.whenComplete((ignored, failure) -> { CompletableFuture<Void> completion = work.whenCompleteAsync((ignored, failure) -> {
completionThread.set(Thread.currentThread()); completionThread.set(Thread.currentThread());
route.close(); route.close();
}); }, executor);
completion.get(5L, TimeUnit.SECONDS); completion.get(5L, TimeUnit.SECONDS);
} finally { } finally {
executor.shutdownNow(); executor.shutdownNow();