From d16f11c2cee60b0a0b4500665c01700c94876a03 Mon Sep 17 00:00:00 2001 From: Martin Krisell Date: Wed, 10 Nov 2021 10:18:31 +0100 Subject: [PATCH] Sort threads to run slowest group first #1 --- lib/test-suites.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/test-suites.js b/lib/test-suites.js index c167436..9ad2cf7 100644 --- a/lib/test-suites.js +++ b/lib/test-suites.js @@ -82,6 +82,9 @@ function distributeTestsByWeight(testSuitePaths) { threads[0].list.push(key); threads[0].weight += +value; } + + // Run slowest group first + threads.sort((a, b) => b.weight - a.weight); return threads; }