File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
server-common/src/test/java/org/apache/kafka/queue Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,10 @@ public void testIdleTimeCallback() throws Exception {
459
459
}));
460
460
assertEquals ("event2-processed" , event2 .get ());
461
461
462
- assertEquals (2 , idleCallCount .get (), "Idle callback should have been called twice" );
462
+ TestUtils .waitForCondition (
463
+ () -> idleCallCount .get () == 2 ,
464
+ "Idle callback should have been called twice"
465
+ );
463
466
assertEquals (waitTime5Ms , lastIdleTimeMs .get (), "Last idle time should be 5ms" );
464
467
465
468
// Test 2: Deferred event
@@ -471,7 +474,10 @@ public void testIdleTimeCallback() throws Exception {
471
474
time .sleep (waitTime2Ms );
472
475
deferredEvent2 .get ();
473
476
474
- assertEquals (waitTime2Ms , lastIdleTimeMs .get (), "Last idle time should be 2ms" );
477
+ TestUtils .waitForCondition (
478
+ () -> idleCallCount .get () == 3 ,
479
+ "Idle callback should have been called three times"
480
+ );
475
481
assertEquals (3 , idleCallCount .get (), "Idle callback should have been called three times" );
476
482
}
477
483
}
You can’t perform that action at this time.
0 commit comments