Skip to content

Commit 6bda038

Browse files
committed
Fix tests
1 parent 934fc3f commit 6bda038

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎core-java/src/test/java/com/baeldung/concurrent/adder/LongAdderTest.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.concurrent.atomic.LongAdder;
99
import java.util.stream.IntStream;
1010

11+
import static com.jayway.awaitility.Awaitility.await;
1112
import static junit.framework.TestCase.assertEquals;
1213

1314
public class LongAdderTest {
@@ -60,6 +61,7 @@ public void givenMultipleThread_whenTheyWriteToSharedLongAdder_thenShouldCalcula
6061
executorService.shutdown();
6162

6263
assertEquals(counter.sumThenReset(), numberOfIncrements * numberOfThreads);
63-
assertEquals(counter.sum(), 0);
64+
65+
await().until(() -> assertEquals(counter.sum(), 0));
6466
}
6567
}

0 commit comments

Comments
 (0)