The tests that timed out under load stay well inside their timeouts #138
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3595-under-load-npm-test-cases-of-1-1-5-s-hit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3595
Under load,
npm testcases that take about 0.5–1 s alone hit vitest's default 5,000 ms per-test timeout, so thefastandfullgates failed with no assertion failing. This PR profiles each test that has timed out under load (hud-css text contrast, hud-mock's scene loop and the two tests its timeout broke, craft's two helipad landing sweeps, collapses' no-scale test and wrecks' Medium shards test), plus lobby-mock's screen loop, which cascades the same way, and lobby-css's contrast loop, which costs what hud-css's does. It cuts each one's cost, or the size of each test, without changing what the tests pin. The global timeout is unchanged, and only test files change.What changes
mesh.count, or none while the mesh is hidden). Slots it was tracking that fall past the count still count as having left. That takes it from 558 to 242 ms alone. The rest of its cost is replaying 318 building falls and 24 structure deaths frame by frame: 62 ms for the collapse matrices, 163 ms for the looks' debris and 20 ms for the structures'. So it now has its own 15 s timeout, with its measured cost stated beside it: 0.25 s alone, and up to 4.6 s with two morenpm testruns on the machine.expectper shard per frame, about 170k. It now takes the fastest spin over each wreck's 3 s and asserts that once: 359 → 128 ms alone.it.each), named for its scene or screen. A HUD scene takes 22–73 ms, against 746 ms for the single loop. The cost is happy-dom matching each stylesheet rule once per element. Memoising the computed-style reads ininksgained nothing (679 vs 672–697 ms), because happy-dom already caches each element's style.document.bodyunder the tests after it.it.eachoverPAD_STARTS). That gives 8 starts for the two-gunship sweep, at 93–163 ms each against 940 ms, and 5 for the lone-gunship sweep, at 63–156 ms each against 449 ms. The two-gunship sweep runs 544 fields and 210k ticks at about 4.5 µs a tick.helipadField()setup takes 0.35 ms, 12% of the sweep, so sharing it would not pay.Under load (runner m5, 18 cores)
Main
d7b69a7, extracted withgit archive, and the head alternated, each runningnpm testunder two loads:yes > /dev/nullloops (one-minute load 22–39). 3 rounds per arm atf013ba6, then 2 at the final496ca08.npm testruns of main beside the measured one (load 24–35). 3 rounds per arm atcb205fa, then 2 at496ca08.Slowest case of each test, in s (✗ = "Test timed out in 5000ms"):
* From the rounds after the split: lobby-mock's split is
cb205fa, after f013ba6's 18-loop rounds, and lobby-css's is496ca08.With
--testTimeout=150, main fails both scene loops and four tests after them, on AssertionErrors:expected [ null, null ] to deeply equal [ 'Monument', 'Growth ×2' ],expected [] to deeply equal [ … ]andexpected null not to be null. Head fails only lobby-mock's first screen, on its timeout.These default-timeout tests are untouched. None of them timed out in any round:
What the tests still pin
DebrisPool.advance, ingit archivecopies of main and the head. One shrinks a piece as it fades (width * (1 - 0.5 * leaving)), the other drops a piece at half its fade (leaving >= 0.5). Each fails the no-scale test on both arms, with the same 330 failures byte for byte.shape.spin * 4) fails the shards test on both arms: main at 7.21 rad/s, head at 7.96 rad/s, against 2.5.The changelog and in-game help are unchanged: nothing a player meets changes.
Gates
fast(run 463's gate #1, tracker gate run 257) atcb205fa: passed,npm test966/966 in 24.5 s.full(run 463's gate #2, tracker gate run 258) at496ca08: passed,npm test972/972 in 26.5 s andtest:phone180/180 in 190 s.Heavy tests stay well inside their timeouts under loadto The tests that timed out under load stay well inside their timeouts