diff --git a/core/src/test/java/art/arcane/iris/generation/mantle/MatterGeneratorConcurrencyTest.java b/core/src/test/java/art/arcane/iris/generation/mantle/MatterGeneratorConcurrencyTest.java index f49e8c3db..62fd60059 100644 --- a/core/src/test/java/art/arcane/iris/generation/mantle/MatterGeneratorConcurrencyTest.java +++ b/core/src/test/java/art/arcane/iris/generation/mantle/MatterGeneratorConcurrencyTest.java @@ -526,10 +526,13 @@ public class MatterGeneratorConcurrencyTest { } private static List> 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> 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; }