This is an automated email from the ASF dual-hosted git repository. lhotari pushed a commit to branch branch-4.1 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit eef4d7eb34c841f9a73fa0c1433d23c4c015baed Author: Philipp Dolif <[email protected]> AuthorDate: Tue Oct 7 06:09:23 2025 +0200 [fix][test] Fix flaky SingleThreadNonConcurrentFixedRateSchedulerTest.testPeriodicTaskCancellation (#24823) (cherry picked from commit 7d35d7cd36ddb692a66bb3441c0cdd2aae0c5f10) --- .../common/util/SingleThreadNonConcurrentFixedRateSchedulerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulsar-common/src/test/java/org/apache/pulsar/common/util/SingleThreadNonConcurrentFixedRateSchedulerTest.java b/pulsar-common/src/test/java/org/apache/pulsar/common/util/SingleThreadNonConcurrentFixedRateSchedulerTest.java index 78ceffb79c4..9e00cf61dcc 100644 --- a/pulsar-common/src/test/java/org/apache/pulsar/common/util/SingleThreadNonConcurrentFixedRateSchedulerTest.java +++ b/pulsar-common/src/test/java/org/apache/pulsar/common/util/SingleThreadNonConcurrentFixedRateSchedulerTest.java @@ -477,9 +477,9 @@ public class SingleThreadNonConcurrentFixedRateSchedulerTest { assertTrue(cancelled); assertTrue(future.isCancelled()); - // Wait and verify no more executions + // Wait and verify no more executions (allowing one execution that was in progress during cancellation) Thread.sleep(200); - assertEquals(executionCount.get(), countBeforeCancel); + assertTrue(executionCount.get() - countBeforeCancel <= 1); } @Test
