Commit 83e1d37
test(flake): per-test event-loop yield in the mocha root hook, scoped to etherpad's own backend specs
PR #7854's first iteration added the yield to 6 known-dying spec files
(pad.ts, importexportGetPost.ts, socketio.ts, messages.ts, import.ts,
clientvar_rev_consistency.ts). Linux backend matrix passed, proving
the yield doesn't break the affected tests' own state-sharing
assumptions. But the very next Win+plugins run captured **death #13
in sessionsAndGroups.ts**, a 7th file outside the scoped fix. The
flake migrated rather than being suppressed.
That's strong evidence the trigger is the rapid-sequential-test
pattern in general, not specific files. Replace the per-file scope
with a root-level `mochaHooks.beforeEach` yield in diagnostics.ts,
gated on a file-path check: yield for ether/etherpad's own specs in
`tests/backend/specs/`, SKIP for plugin tests loaded from
`../node_modules/ep_*/static/tests/backend/specs/`.
The plugin-test skip exists because PR #7844 demonstrated that an
unconditional global yield breaks `ep_subscript_and_superscript`'s
`returns HTML with Subscript HTML tags` series — those plugin tests
share state across describe-block boundaries and don't tolerate any
microtask reordering. The file-path check preserves PR #7844's
finding without re-breaking those tests.
Files modified:
- src/tests/backend/diagnostics.ts: root beforeEach yield, scoped
Per-file changes from the previous commit are reverted — root scope
supersedes them and there's no point yielding twice per test.
Test plan unchanged from the original PR:
- Linux ± plugins must pass.
- Windows ± plugins flake rate: ~22% pre-fix. Post-fix, run the CI
5-10x and compare. If unchanged, cadence is ruled out as the
trigger and we look at per-test pathologies (jose CNG on
Windows, libuv IOCP edge cases unrelated to load).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c4d2467 commit 83e1d37
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
217 | 235 | | |
218 | 236 | | |
219 | 237 | | |
| |||
0 commit comments