Skip to content

test: make http2-alpn control requests explicit#5252

Open
trivikr wants to merge 1 commit intonodejs:mainfrom
trivikr:test-http2-alpn
Open

test: make http2-alpn control requests explicit#5252
trivikr wants to merge 1 commit intonodejs:mainfrom
trivikr:test-http2-alpn

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 7, 2026

This relates to...

Fixes: #5212

Rationale

The HTTP/1.1 control requests in test/http2-alpn.js relied on Node's default https ALPN behavior and asserted alpnProtocol === false.

That ALPN detail is incidental to the behavior this test is meant to verify. The important distinction is that Undici negotiates h2 when allowH2 is enabled, while the same allowHTTP1: true server can still handle an HTTP/1.1 request.

Make the control request explicitly HTTP/1.1 so the test documents that intent directly and avoids depending on the default ALPN behavior of https.

Changes

  • Make HTTP/1.1 control requests in test/http2-alpn.js pass ALPNProtocols: ['http/1.1'].
  • Update the expected ALPN assertions to http/1.1.
  • End the POST control request with its body instead of only writing the body.

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 (01122da) to head (1437e4b).

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

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

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\http2-alpn.js

2 participants