fix(test): resolve CI-breaking flaky duration assertion in agentic-flow-agent tests - #3059
Open
ruvnet wants to merge 1 commit into
Open
fix(test): resolve CI-breaking flaky duration assertion in agentic-flow-agent tests#3059ruvnet wants to merge 1 commit into
ruvnet wants to merge 1 commit into
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainreported by the test ratchet (run 32091740244, commitfa13ee4a— the same commit had passed CI the previous day, confirming this is timing flakiness, not a real regression).agentic-flow-agent.test.tsassertedresult.duration/agent.metrics.avgTaskDurationare strictly> 0. The implementation measuresDate.now()before/after a task whose local-execution fallback only guarantees asetTimeout(1)delay. Under CI's coarser clock resolution, both samples can land in the same millisecond, making duration legitimately0.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.tsinv3/@claude-flow/integration— 11/11 passing locally.