Unverified Commit 77874b8e authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

refactor(CI): Assign tests to groups round-robin instead of sequentially when we…

refactor(CI): Assign tests to groups round-robin instead of sequentially when we don't have timings (#76462)

Our CI runs tests in parallel across multiple groups. We want test groups to all take similar amounts of time to decrease overall latency, and to reduce the chance of test group timeouts in CI.

There's logic here to assign intelligently to groups based on previous test timing information, but if there's no timing information for whatever reason (e.g. we don't currently use timings for rspack/turbopack integration tests), then we were assigning them to groups sequentially.

Because tests with similar paths tend to have similar performance characteristics, it's better to assign every nth test to each group, similar to round-robin assignment.
parent 0f02b289
...@@ -381,9 +381,9 @@ async function main() { ...@@ -381,9 +381,9 @@ async function main() {
Math.round(groupTimes[curGroupIdx]) + 's' Math.round(groupTimes[curGroupIdx]) + 's'
) )
} else { } else {
const numPerGroup = Math.ceil(tests.length / groupTotal) // assign every nth test "round-robin" to the group, so that similar slow
let offset = (groupPos - 1) * numPerGroup // tests tend not to get clustered together
tests = tests.slice(offset, offset + numPerGroup) tests = tests.filter((_value, idx) => idx % groupTotal === groupPos - 1)
console.log('Splitting without timings') console.log('Splitting without timings')
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment