Skip to content

test: add regression test for issue #1373 — default headersTimeout 300s#5467

Open
SNTL84 wants to merge 1 commit into
nodejs:mainfrom
SNTL84:fix/issue-1373-default-timeout-test
Open

test: add regression test for issue #1373 — default headersTimeout 300s#5467
SNTL84 wants to merge 1 commit into
nodejs:mainfrom
SNTL84:fix/issue-1373-default-timeout-test

Conversation

@SNTL84

@SNTL84 SNTL84 commented Jun 30, 2026

Copy link
Copy Markdown

What

Adds a regression test test/issue-1373-default-timeout.js that confirms undici's default headersTimeout is 300e3 ms (300s), not the old 30s that caused issues in #1373.

Why

Issue #1373 was raised because the default fetch timeout was 30s, causing failures for slow-responding servers. The fix (aligning with Chrome's 300s default) appears to have been applied in:

However there was no regression test to prevent this from silently reverting. This PR fills that gap.

Test Approach

The test spins up an HTTP server that intentionally delays its response by 35 seconds — beyond the old 30s default but well within the 300s default. A HeadersTimeoutError would signal a regression.

test/issue-1373-default-timeout.js

Checklist

  • Regression test added
  • Follows existing test conventions (node:test, node:http, require('..'))
  • No changes to source or docs needed (defaults are already correct)

Contributed by Milan Soni (SNTL84) · github.com/SNTL84
Open to OSS sponsorship & consulting — AI workflows, automation & full-stack builds · desidevloper.com

…t 300s

Verifies that undici's fetch does not throw HeadersTimeoutError for a
server that responds after 35s, confirming the 300e3ms default is in
effect and the old 30s behaviour does not regress.

Fixes: nodejs#1373
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.46%. Comparing base (907bc33) to head (c29b0b0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5467   +/-   ##
=======================================
  Coverage   93.46%   93.46%           
=======================================
  Files         110      110           
  Lines       37115    37115           
=======================================
  Hits        34690    34690           
  Misses       2425     2425           

☔ 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.

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