Skip to content

Commit

Permalink
Merge pull request #395 from bstansberry/Issue_394
Browse files Browse the repository at this point in the history
[Issue_394] If ReactiveStreamsPublisherTckTest.createPublisher is cal…
  • Loading branch information
Emily-Jiang authored Oct 10, 2024
2 parents 691b493 + 24da017 commit 74ea30f
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ public Publisher<InboundSseEvent> createPublisher(long elements) {

CountDownLatch stopLatch = new CountDownLatch(1);
try {
if (cleanupLatch != null) {
// We null out cleanupLatch in a @BeforeTest method, so if it is not null
// we must be in a test that calls this multiple times in a single @Test method,
// e.g. a stochastic test. In this case we can't rely on having awaited cleanupLatch
// in our @AfterTest method, and we need to do it ourselves.
if (!cleanupLatch.await(30, TimeUnit.SECONDS)) {
// Just log; maybe by the time we create a new server the old one will be stopped.
LOG.error("Server did not close long after test completed");
}
}
cleanupLatch = new CountDownLatch(1);
AtomicReference<Throwable> serverException = launchServer(stopLatch, es -> {
for (long i = 0; i < elements; i++) {
Expand Down

0 comments on commit 74ea30f

Please sign in to comment.