We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 102e0ab commit 24fcc00Copy full SHA for 24fcc00
analytics/src/test/java/com/segment/analytics/AnalyticsTest.java
@@ -19,6 +19,7 @@
19
import java.util.Collections;
20
import java.util.concurrent.ExecutorService;
21
import java.util.concurrent.Executors;
22
+import java.util.concurrent.TimeUnit;
23
import java.util.concurrent.atomic.AtomicInteger;
24
import org.junit.Before;
25
import org.junit.Test;
@@ -143,7 +144,7 @@ public void threadSafeTest(MessageBuilderTest builder)
143
144
} while (initialTime.until(now, ChronoUnit.MILLIS) < millisRunning);
145
146
service.shutdown();
- while (!service.isShutdown() || !service.isTerminated()) {}
147
+ service.awaitTermination(5, TimeUnit.SECONDS);
148
149
verify(spy, times(counter.get())).enqueue(any(Message.class));
150
}
0 commit comments