Skip to content

Commit

Permalink
Fix spotbugs checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-anderson committed Dec 1, 2023
1 parent 938ef26 commit e85067e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -39,7 +38,7 @@ void tasksAreExecuted() throws InterruptedException {
// submit two tasks and they should both complete.
executor.execute(() -> latch.countDown());
executor.execute(() -> latch.countDown());
latch.await(5, TimeUnit.SECONDS);
latch.await();
}

@Test
Expand Down Expand Up @@ -112,7 +111,7 @@ void manyThreadsCanSubmitTasksConcurrently() throws InterruptedException {
Thread t = new Thread(() -> {
try {
ready.countDown();
barrier.await(5, TimeUnit.SECONDS);
barrier.await();
executor.execute(() -> completed.countDown());
} catch (Exception ex) {
throw new AssertionError("unexpected error", ex);
Expand All @@ -126,6 +125,6 @@ void manyThreadsCanSubmitTasksConcurrently() throws InterruptedException {
barrier.countDown();
// all tasks should have completed. Note that all thread are racing with each other to
// submit work so the order of work execution isn't important.
completed.await(5, TimeUnit.SECONDS);
completed.await();
}
}

0 comments on commit e85067e

Please sign in to comment.