Skip to content

test: resolve flaky timeout in issue-3356#5188

Merged
mcollina merged 1 commit into
nodejs:mainfrom
trivikr:test-3356
May 5, 2026
Merged

test: resolve flaky timeout in issue-3356#5188
mcollina merged 1 commit into
nodejs:mainfrom
trivikr:test-3356

Conversation

@trivikr

@trivikr trivikr commented May 4, 2026

Copy link
Copy Markdown
Member

This relates to...

Fixes: #5179

Rationale

The issue-3356.js test is flaky, intermittently timing out after 180s. The root cause is a mismatch between the bodyTimeout: 50 (50ms) and undici's fast timer resolution (~1s). The timeout soemtimes doesn't fire before the server completes its 100ms delayed response, leaving the assertion plan unsatisfied and the test hanging.

Changes

Features

N/A

Bug Fixes

  • Increased bodyTimeout to 1500ms (above the ~1s timer resolution)
  • Increased server delay to 3000ms (ensures body timeout fires first)
  • Called fastTimersTick(2000) to deterministically advance the clock past the timeout threshold
  • Added minTimeout/maxTimeout to RetryAgent to reduce unnecessary retry delay in the test

Breaking Changes and Deprecations

N/A

Status

Assisted-by: claude:opus-4.6

Assisted-by: claude:opus-4.6
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.26%. Comparing base (a07d945) to head (5b43660).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5188      +/-   ##
==========================================
- Coverage   93.28%   93.26%   -0.02%     
==========================================
  Files         110      110              
  Lines       36313    36313              
==========================================
- Hits        33873    33869       -4     
- Misses       2440     2444       +4     

☔ View full report in Codecov by Sentry.
📢 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.

@mcollina mcollina 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.

lgtm

@mcollina mcollina merged commit 6e042f7 into nodejs:main May 5, 2026
160 of 165 checks passed
@trivikr trivikr deleted the test-3356 branch May 6, 2026 21:46
@github-actions github-actions Bot mentioned this pull request May 14, 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/issue-3356.js

3 participants