Poll instead of sleeping

- Add the Await test helper that polls a condition every ten milliseconds under a bounded timeout
- Replace every Thread.sleep in the fourteen polling test classes with a condition wait, a latch wait or a bounded quiet window
- Keep the crash-consistency fsync interception in GenerationHistoryAdmissionTest and SavedBiomeStoreBatchTest on real barriers
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-08 04:28:17 -04:00
1 parent c75b0e01af
commit 42798c6340
15 files changed
+174 -193

No files matched your search

@@ -32,6 +32,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.LockSupport;
import java.util.function.IntConsumer;
import static org.junit.Assert.assertEquals;
@@ -218,7 +219,7 @@ public class NativeStructureVolumeIndexTest {
if (cleared) {
break;
}
Thread.sleep(1);
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10L));
}
assertTrue("Origin eviction did not complete before the query cache lock", cleared);
resolver.release();