From f71ed2430b40b572028031cf5a9654b1e4b41839 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sun, 21 Jan 2024 09:36:57 +0100 Subject: [PATCH] Fix shouldShortcircuitOnExceptionTest (#815) --- src/test/java/com/pivovarit/collectors/TestUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/pivovarit/collectors/TestUtils.java b/src/test/java/com/pivovarit/collectors/TestUtils.java index 2d790b48..40f722d2 100644 --- a/src/test/java/com/pivovarit/collectors/TestUtils.java +++ b/src/test/java/com/pivovarit/collectors/TestUtils.java @@ -36,8 +36,8 @@ public static T returnWithDelay(T value, Duration duration) { return value; } - public static Integer incrementAndThrow(AtomicInteger counter) { - if (counter.incrementAndGet() == 10) { + public synchronized static Integer incrementAndThrow(AtomicInteger counter) { + if (counter.incrementAndGet() >= 10) { throw new IllegalArgumentException(); }