altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

Two tests flaky under parallel CI load (S27 sql_analyze + trace snapshot)

Open anandgupta42 opened this issue 6 months ago • 0 comments

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.

  1. test/session/real-tool-simulation.test.ts → S27: sql_analyze with parse error. The progressive-suggestion dedup is a module-global Set; the beforeEach reset used a dynamic await import that can resolve to a different module instance than the tool's static import under parallel CI → real Set never reset → S27 sees no suggestion.
  2. 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.

anandgupta42 avatar Jun 03 '26 23:06 anandgupta42