Skip to content

test: add unexpected disconnect guards to remaining http2 tests - #5686

Merged
metcoder95 merged 1 commit into
nodejs:mainfrom
zeexzeex:test/http2-disconnect-guards
Aug 13, 2026
Merged

test: add unexpected disconnect guards to remaining http2 tests#5686
metcoder95 merged 1 commit into
nodejs:mainfrom
zeexzeex:test/http2-disconnect-guards

Conversation

@zeexzeex

Copy link
Copy Markdown
Contributor

Adds the disconnect guard pattern from docs/docs/best-practices/writing-tests.md to the remaining happy-path HTTP/2 test files, so silent disconnect/reconnect cycles fail the tests instead of passing unnoticed. Follow-up to #5533.

Files covered (13 guards): http2-agent.js (1, on an Agent), http2-alpn.js (2), http2-trailers.js (1, converted to tspl since every existing guard relies on tspl's t.fail), http2-dispatcher.js (9, including the forward client in Dispatcher#Connect).

Intentionally skipped: the upgrade/abort/destroy/reject tests in http2-dispatcher.js (disconnect expected or no connection), http2-stream.js (server destroys every stream), http2-max-concurrent-streams-zero.js (drain behavior under test), and 4 unit-test files that mock the h2 internals with no real connection (http2-late-data.js, http2-response-after-completion.js, http2-window-size.js, http2-resume-null-request.js).

Verified: all 23 tests pass, 10 consecutive full runs with no flakes, and a manual spot check confirmed the guard turns a mid-test session teardown into a failure instead of a silent reconnect.

Refs: #251

@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5686      +/-   ##
==========================================
+ Coverage   93.43%   93.44%   +0.01%     
==========================================
  Files         110      110              
  Lines       38733    38776      +43     
==========================================
+ Hits        36190    36236      +46     
+ Misses       2543     2540       -3     

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

@metcoder95
metcoder95 merged commit 5908018 into nodejs:main Aug 13, 2026
37 of 38 checks passed
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.

3 participants