Skip to content

Commit

Permalink
Throw exception if a latch times out
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatan-ivanov committed Sep 5, 2024
1 parent ef7c61f commit 4e8871f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ void should_open_and_close_scopes_with_reactor_multithreaded() {
}
else {
try {
latch.await(1, TimeUnit.SECONDS);
if (!latch.await(1, TimeUnit.SECONDS)) {
throw new RuntimeException("Waiting for the latch timed out!");
}
}
catch (InterruptedException e) {
// ignore
Expand Down Expand Up @@ -253,7 +255,9 @@ void should_open_and_close_scopes_with_reactor_multithreaded() {
Observation obs4 = Observation.start("4", observationRegistry);
try (Observation.Scope scope4 = obs4.openScope()) {
logger.info("FRESH SPAN AFTER [{}]", tracer.currentSpan());
cleanupLatch.await(1, TimeUnit.SECONDS);
if (!cleanupLatch.await(1, TimeUnit.SECONDS)) {
throw new RuntimeException("Waiting for the latch timed out!");
}
}
catch (InterruptedException e) {
// ignore
Expand Down

0 comments on commit 4e8871f

Please sign in to comment.