Skip to content

Fix flaky converge timing tests on CI#203

Open
taras wants to merge 2 commits intomainfrom
fix/flaky-converge-test
Open

Fix flaky converge timing tests on CI#203
taras wants to merge 2 commits intomainfrom
fix/flaky-converge-test

Conversation

@taras
Copy link
Copy Markdown
Member

@taras taras commented Mar 27, 2026

Summary

  • Widen timestamp tolerance from 5ms to 50ms in the "resolves with a stats object" tests for both when and always
  • The 5ms window between the test's Date.now() and convergeOn's internal Date.now() was too tight — effection scheduling overhead can exceed 5ms on slow macOS CI runners

Test plan

  • All 17 converge tests pass locally
  • CI passes on all platforms (the fix specifically targets the intermittent macOS failure)

Summary by CodeRabbit

  • Tests
    • Updated test assertions to increase timing tolerance for improved reliability during test execution.

Widen timestamp tolerance from 5ms to 50ms in "resolves with a stats
object" tests for both `when` and `always`. The 5ms window was too
tight for slow CI runners where effection scheduling overhead between
the test's Date.now() and the internal Date.now() can exceed 5ms.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b59244b2-275e-4a89-b96e-05e3dbde9388

📥 Commits

Reviewing files that changed from the base of the PR and between a6ec310 and 7359cc2.

📒 Files selected for processing (1)
  • converge/converge.test.ts

📝 Walkthrough

Walkthrough

Updated timing assertion tolerances in test suite for stats objects returned by when and always functions, expanding the acceptable time ranges from ±5 milliseconds to ±50 milliseconds for stats.start and stats.end measurements.

Changes

Cohort / File(s) Summary
Test Timing Assertions
converge/converge.test.ts
Relaxed timing tolerance bounds for stats.start upper limit (from +5 to +50ms) and stats.end lower limit (from -5 to -50ms) in time-based test assertions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: widening timestamp tolerances to fix flaky timing tests in CI, which is the core objective of this PR.
Description check ✅ Passed The description covers the key information (problem statement, solution, and test plan) but doesn't follow the provided template structure with explicit 'Motivation' and 'Approach' sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Policy Compliance ✅ Passed Pull request is fully compliant with all applicable policies. Only test files were modified, making Version Bump policy inapplicable. No Agent Marketing or promotional material found. Package.json Metadata policy does not apply.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/flaky-converge-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@effectionx/converge@203

commit: 7359cc2

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.

2 participants