diff --git a/test_runner/src/main/kotlin/ftl/run/RunningDevices.kt b/test_runner/src/main/kotlin/ftl/run/RunningDevices.kt index b73ebb5a5e..5dd3642c3d 100644 --- a/test_runner/src/main/kotlin/ftl/run/RunningDevices.kt +++ b/test_runner/src/main/kotlin/ftl/run/RunningDevices.kt @@ -70,5 +70,7 @@ class RunningDevices(stopwatch: StopWatch, testExecutions: List) fun next(): RunningDevice? = devices.firstOrNull { it.complete.not() } + fun allRunning(): List = devices.filter { it.complete.not() } + fun allComplete(): Boolean = devices.all { it.complete } } diff --git a/test_runner/src/main/kotlin/ftl/run/TestRunner.kt b/test_runner/src/main/kotlin/ftl/run/TestRunner.kt index 01bb1eab48..9edd717b4a 100644 --- a/test_runner/src/main/kotlin/ftl/run/TestRunner.kt +++ b/test_runner/src/main/kotlin/ftl/run/TestRunner.kt @@ -289,8 +289,9 @@ object TestRunner { while (true) { if (matrices.map[matrixId]?.update(refreshedMatrix) == true) updateMatrixFile(matrices, args) - val nextDevice = runningDevices.next() ?: return - nextDevice.poll(refreshedMatrix) + runningDevices.allRunning().forEach { nextDevice -> + nextDevice.poll(refreshedMatrix) + } // Matrix has 0 or more devices (test executions) if (runningDevices.allComplete()) {