Waited for occupied dispatcher in test

- Concurrency test starts generation only after every burst worker is blocked
This commit is contained in:
Brian Neumann-Fopiano committed 2026-10-22 12:11:48 -04:00
1 parent 60eec4e2ee
commit c3b3f1d8aa
1 file changed
+10 -1
@@ -526,10 +526,13 @@ public class MatterGeneratorConcurrencyTest {
}
private static List<Future<?>> occupyDispatcher(CountDownLatch release) {
int blockers = Math.max(1, MultiBurst.burst.parallelism()) * 4;
int parallelism = Math.max(1, MultiBurst.burst.parallelism());
int blockers = parallelism * 4;
CountDownLatch started = new CountDownLatch(parallelism);
List<Future<?>> futures = new ArrayList<>(blockers);
for (int index = 0; index < blockers; index++) {
futures.add(MultiBurst.burst.submit(() -> {
started.countDown();
try {
assertTrue(release.await(30L, TimeUnit.SECONDS));
} catch (InterruptedException interruption) {
@@ -537,6 +540,12 @@ public class MatterGeneratorConcurrencyTest {
}
}));
}
try {
assertTrue(started.await(30L, TimeUnit.SECONDS));
} catch (InterruptedException interruption) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted while occupying the burst dispatcher.", interruption);
}
return futures;
}