Skip to content

test: fix flaky test-http2-close-while-writing#61804

Open
Han5991 wants to merge 1 commit intonodejs:mainfrom
Han5991:test/fix-flaky-http2-close-while-writing
Open

test: fix flaky test-http2-close-while-writing#61804
Han5991 wants to merge 1 commit intonodejs:mainfrom
Han5991:test/fix-flaky-http2-close-while-writing

Conversation

@Han5991
Copy link
Contributor

@Han5991 Han5991 commented Feb 13, 2026

The test was flaky due to a race condition where client.close() would
wait for a graceful shutdown while the server had already destroyed the
session/stream, leading to a timeout.

Changes:

  • Replace client.close() with client.destroy() in the close event
    handler of the client stream.
  • Add common.mustNotCall() error handlers to the client, client stream,
    and server session to catch unexpected errors.
  • Add check if (!client_stream.destroyed) before destroying client
    stream in the server's data handler.

Refs: #33156

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Feb 13, 2026
ca,
maxSessionMemory: 1000
});
client.on('error', common.mustNotCall());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
client.on('error', common.mustNotCall());

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.76%. Comparing base (3d30c30) to head (df7750e).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61804      +/-   ##
==========================================
+ Coverage   89.75%   89.76%   +0.01%     
==========================================
  Files         675      675              
  Lines      204676   204731      +55     
  Branches    39329    39343      +14     
==========================================
+ Hits       183705   183779      +74     
+ Misses      13272    13238      -34     
- Partials     7699     7714      +15     

see 39 files with indirect coverage changes

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

@Han5991 Han5991 force-pushed the test/fix-flaky-http2-close-while-writing branch from df7750e to bcab32d Compare February 13, 2026 22:32
The test was flaky due to a race condition where `client.close()` would
wait for a graceful shutdown while the server had already destroyed the
session/stream, leading to a timeout.

Changes:
- Replace `client.close()` with `client.destroy()` in the `close`
  event handler of the client stream.

Refs: nodejs#33156
@Han5991 Han5991 force-pushed the test/fix-flaky-http2-close-while-writing branch from bcab32d to 4bc4b5d Compare February 13, 2026 22:34
@Han5991 Han5991 requested a review from lpinca February 13, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants