Skip to content

test: deflake issue-5137 stream count assertion#5243

Open
trivikr wants to merge 1 commit intonodejs:mainfrom
trivikr:test-issue-5137
Open

test: deflake issue-5137 stream count assertion#5243
trivikr wants to merge 1 commit intonodejs:mainfrom
trivikr:test-issue-5137

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 6, 2026

This relates to...

Fixes: #5218

Rationale

test/issue-5137.js could intermittently fail on macOS GitHub runners because it asserted the server-side HTTP/2 stream count immediately after the client request rejected. With a short stream timeout, the final retry could be dispatched but the server stream event might not have been observed yet.

Changes

The test now waits until the server observes all 3 expected request attempts before asserting the stream count, with a bounded 1s fallback so real retry regressions still fail.

Features

N/A

Bug Fixes

N/A

Breaking Changes and Deprecations

N/A

Status

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.27%. Comparing base (4f8f814) to head (c15c29a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5243   +/-   ##
=======================================
  Coverage   93.27%   93.27%           
=======================================
  Files         110      110           
  Lines       36366    36366           
=======================================
  Hits        33922    33922           
  Misses       2444     2444           

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

Comment thread test/issue-5137.js
})
])
clearTimeout(streamCountTimeout)

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.

Instead of this, we should assert that there are at least 3 chunks, not exactly 3.

Copy link
Copy Markdown
Member Author

@trivikr trivikr May 6, 2026

Choose a reason for hiding this comment

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

On line 32?

    streamCount++
    if (streamCount === 3) { // <-- This one
      resolveStreamCount()
    }

Since it checks immediately after incrementing streamCount, the === should be okay.

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-5137.js

3 participants