Skip to content

Commit 33e5796

Browse files
mtopolnikclaude
andcommitted
Add sleep to stress test acker spin loop
The acker thread in testHighConcurrencyStress() spun in a tight loop with no sleep when there was nothing new to acknowledge, wasting CPU. Add Thread.sleep(1) in the else branch, matching the pattern already used in testConcurrentAddAndCumulativeAck(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6d30696 commit 33e5796

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/test/java/io/questdb/client/test/cutlass/qwp/client/InFlightWindowTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,9 @@ public void testHighConcurrencyStress() throws Exception {
612612
if (highest > lastAcked) {
613613
window.acknowledgeUpTo(highest);
614614
lastAcked = highest;
615+
} else {
616+
Thread.sleep(1);
615617
}
616-
// No sleep - maximum contention
617618
}
618619
} catch (Throwable t) {
619620
error.set(t);

0 commit comments

Comments
 (0)