File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
tck/src/main/java/org/eclipse/microprofile/rest/client/tck/sse Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,16 @@ public Publisher<InboundSseEvent> createPublisher(long elements) {
102102
103103 CountDownLatch stopLatch = new CountDownLatch (1 );
104104 try {
105+ if (cleanupLatch != null ) {
106+ // We null out cleanupLatch in a @BeforeTest method, so if it is not null
107+ // we must be in a test that calls this multiple times in a single @Test method,
108+ // e.g. a stochastic test. In this case we can't rely on having awaited cleanupLatch
109+ // in our @AfterTest method, and we need to do it ourselves.
110+ if (!cleanupLatch .await (30 , TimeUnit .SECONDS )) {
111+ // Just log; maybe by the time we create a new server the old one will be stopped.
112+ LOG .error ("Server did not close long after test completed" );
113+ }
114+ }
105115 cleanupLatch = new CountDownLatch (1 );
106116 AtomicReference <Throwable > serverException = launchServer (stopLatch , es -> {
107117 for (long i = 0 ; i < elements ; i ++) {
You can’t perform that action at this time.
0 commit comments