Skip to content

test: deflake connect-timeout watchdog#5197

Merged
metcoder95 merged 3 commits into
mainfrom
fix-5187-connect-timeout-flake
Jul 3, 2026
Merged

test: deflake connect-timeout watchdog#5197
metcoder95 merged 3 commits into
mainfrom
fix-5187-connect-timeout-flake

Conversation

@mcollina

@mcollina mcollina commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

  • deflake the connect-timeout tests by using a shared helper for Client and Pool
  • replace the aggressive 2s watchdog with a longer guard that matches FastTimer behavior and the extra Windows setImmediate hop
  • use test-scoped cleanup that tolerates an already-closed dispatcher

Testing

  • npx borp -p "test/connect-timeout.js"
  • npx eslint test/connect-timeout.js

Closes #5187

@codecov-commenter

codecov-commenter commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.43%. Comparing base (61ddd8e) to head (acc19a5).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5197      +/-   ##
==========================================
- Coverage   93.44%   93.43%   -0.02%     
==========================================
  Files         110      110              
  Lines       37175    37278     +103     
==========================================
+ Hits        34740    34829      +89     
- Misses       2435     2449      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread test/connect-timeout.js

@metcoder95 metcoder95 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge conflicts

@mcollina mcollina force-pushed the fix-5187-connect-timeout-flake branch from be6f49e to 74c219a Compare May 19, 2026 07:49
Comment thread test/connect-timeout.js Outdated
@AliMahmoudDev

Copy link
Copy Markdown
Contributor

The refactor to extract assertConnectTimeout and use t.after(() => client.close().catch(() => {})) instead of the global after() is much cleaner. Using .catch(() => {}) on close prevents teardown errors from masking the actual timeout assertion. The watchdog timeout inside the Promise constructor is a good safety net.

@mcollina

Copy link
Copy Markdown
Member Author

@metcoder95 @trivikr ptal

@metcoder95

Copy link
Copy Markdown
Member

Justs tests are not happy

@mcollina mcollina force-pushed the fix-5187-connect-timeout-flake branch from 58c121f to acc19a5 Compare July 2, 2026 17:23
@metcoder95 metcoder95 merged commit 7ef4e84 into main Jul 3, 2026
38 checks passed
@metcoder95 metcoder95 deleted the fix-5187-connect-timeout-flake branch July 3, 2026 08:40
@github-actions github-actions Bot mentioned this pull request Jul 4, 2026
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.

[flaky] test\connect-timeout.js

5 participants