Utils: fix a race in hash set queue test

This commit is contained in:
2025-03-27 12:13:04 +01:00
parent 038b873364
commit d9ded36891

View File

@@ -62,7 +62,7 @@ public class HashSetDelayedBlockingQueueTest {
}
});
var thing = queue.getAllWait(); // Theoretically you can get one...
if (thing.size() == 1) thing.add(queue.getAllWait());
if (thing.size() == 1) thing.addAll(queue.getAllWait());
var gotTime = System.currentTimeMillis();
Assertions.assertIterableEquals(List.of("hello1", "hello2"), thing);
Assertions.assertTrue((gotTime - curTime) >= 1010);