Skip to content

fix(test): resolve CI-breaking flaky duration assertion in agentic-flow-agent tests - #3059

Open
ruvnet wants to merge 1 commit into
mainfrom
fix/ci-agentic-flow-agent-duration-flake
Open

fix(test): resolve CI-breaking flaky duration assertion in agentic-flow-agent tests#3059
ruvnet wants to merge 1 commit into
mainfrom
fix/ci-agentic-flow-agent-duration-flake

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes the CI break on main reported by the test ratchet (run 32091740244, commit fa13ee4a — the same commit had passed CI the previous day, confirming this is timing flakiness, not a real regression).
  • agentic-flow-agent.test.ts asserted result.duration / agent.metrics.avgTaskDuration are strictly > 0. The implementation measures Date.now() before/after a task whose local-execution fallback only guarantees a setTimeout(1) delay. Under CI's coarser clock resolution, both samples can land in the same millisecond, making duration legitimately 0.
  • Relaxed both assertions to toBeGreaterThanOrEqual(0), which still verifies duration is a valid non-negative measurement without depending on sub-millisecond CI clock precision.

Test plan

  • npx vitest run src/__tests__/agentic-flow-agent.test.ts in v3/@claude-flow/integration — 11/11 passing locally.
  • No production code changed; this is a test-assertion correction only.

…ow-agent tests

CI's test ratchet flagged agentic-flow-agent.test.ts as an unexpected new
failure (run 32091740244, same commit fa13ee4 that passed the day before).
result.duration is Date.now()-delta over a ~1ms setTimeout; under coarse CI
clock resolution the two samples can land in the same millisecond, making
duration legitimately 0. Relax the two affected assertions from
toBeGreaterThan(0) to toBeGreaterThanOrEqual(0).
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