altimate-code
altimate-code copied to clipboard
Two tests flaky under parallel CI load (S27 sql_analyze + trace snapshot)
Problem
Two tests pass locally but fail consistently in CI's parallel run (9474 tests / 378 files), failing identically on unrelated PRs (#854, #858, #863) and blocking all of them. The repo's "no flaky tests under resource contention" case.
test/session/real-tool-simulation.test.ts→ S27: sql_analyze with parse error. The progressive-suggestion dedup is a module-globalSet; thebeforeEachreset used a dynamicawait importthat can resolve to a different module instance than the tool's static import under parallel CI → real Set never reset → S27 sees no suggestion.test/altimate/tracing-adversarial-snapshot.test.ts→ buildTraceFile shows 'running' status. Waited a fixed 50ms for a debounced async snapshot write — too short under CI load → reads a stale snapshot.
Fix
- S27: static import of
PostConnectSuggestions(same instance the tools use) + explicit reset in the test. - Trace test: poll the on-disk status until expected instead of a fixed sleep.
Unblocks #854/#858/#863.