Menu

Use case: telling flaky tests from broken ones with parallel sandboxes
📰

Use case: telling flaky tests from broken ones with parallel sandboxes

DEV Community: typescript·Sandscale·9 days ago
#Yfs5MpBE
#devtotypescript#devto#dev#test#sandboxes
Long article (1034 words) — no AI summary yet.
Reading 0:00
15s threshold

A test fails in CI. Is your change broken, or is the test flaky? Developers answer that by hitting "re-run" and hoping. Coding agents are worse at it: an agent that sees a red test will try to fix it, and if the test is flaky, it will "fix" code that was never broken, or declare victory when the rerun happens to pass.

A better answer is to measure: run the test many times in clean environments and look at the pattern. This use case does that in parallel Sandscale sandboxes , each started from the same snapshot.

Why several sandboxes, not one loop

Running a test 30 times in one environment finds some flakiness, but misses failures that depend on state the first run left behind, or on things that differ between machines. Spreading attempts across fresh sandboxes from the same snapshot gives you both: repeated attempts within a box, and independent boxes with identical starting files.

The code

Type-checked with tsc --strict against @sandscale/sdk 1.0.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.