Skip to content

fix(cli-e2e): stabilise liveness-sweep "untouched" test on slow CI#30

Merged
spencermarx merged 1 commit into
mainfrom
fix/cli-e2e-liveness-untouched-flake
May 6, 2026
Merged

fix(cli-e2e): stabilise liveness-sweep "untouched" test on slow CI#30
spencermarx merged 1 commit into
mainfrom
fix/cli-e2e-liveness-untouched-flake

Conversation

@spencermarx
Copy link
Copy Markdown
Owner

Summary

  • ocr session liveness sweep > leaves a row whose heartbeat was just bumped untouched was flaking on hosted macOS and Ubuntu runners after v1.11.0 landed
  • Root cause: 1-second heartbeat threshold vs ~1.5s of cumulative CLI overhead between session beat and the next session start-instance (which triggers the sweep) — the row got reclassified to orphaned before the assertion ran
  • Fix: bump this test's threshold to 5s and stretch the pre-beat wait to 6s. The test still proves "beat revives a stale row" but with 4+ seconds of headroom in the beat→sweep window
  • Sibling orphan-path test keeps the 1s threshold (it benefits from timing slop rather than fighting it)

Test plan

  • Local: 3 consecutive runs all pass at ~7.1s each
  • CI: API E2E (ubuntu-latest)
  • CI: API E2E (macos-latest)

🤖 Generated with claude-flow

The test was using a 1-second heartbeat threshold while two sequential
CLI invocations (`session beat` then `session start-instance`) each
take ~700-800ms on hosted macOS/Ubuntu runners. The cumulative latency
between bumping the heartbeat and the sweep reading it routinely
crossed 1s, so the row was wrongly reclassified to `orphaned` before
the assertion ran.

Bump the threshold for this test to 5s and stretch the pre-beat wait
to 6s so the original heartbeat is still unambiguously stale (the test
still proves "beat revives a stale row"), but the beat → sweep window
has 4+ seconds of headroom — well beyond CI CLI overhead.

The orphan-path test in the same suite keeps its 1s threshold because
it benefits from timing slop rather than fighting it.

Verified locally: 3/3 runs pass at ~7.1s each.

Co-Authored-By: claude-flow <ruv@ruv.net>
@spencermarx spencermarx merged commit b959360 into main May 6, 2026
3 checks passed
@spencermarx spencermarx deleted the fix/cli-e2e-liveness-untouched-flake branch May 6, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant