-
fix(ui-tests): stop logpanel prune-cap counter test timing out (#5057)
发布于
2026-07-11 21:02:59 +00:00 The 'decrements the matching category count when the cap prunes an entry'
test fills the DOM to the real 500-entry cap (501 addLog calls). Each call
queues a real setTimeout(autoscroll, 0) (logpanel.js:1138) on top of O(n^2)
querySelectorAll DOM scans, blowing the 5s vitest default under parallel CI
load. Two sibling describe blocks already fixed this identical flake (release
notes 1.8.1 / #4304); the 'per-category counters' block was missed.A block-level beforeEach is intentionally avoided because the block's
'recomputes counts from the DOM after batch load' test depends on a real
setTimeout(resolve, 10). Fake timers are instead scoped to the one heavy
test, with a block-level afterEach safety net (mirrors the sibling cleanup,
including fetch teardown) that guarantees real timers are restored even on
failure.下载附件