net.http: fix server_tls h2-negotiation test for default-on HTTP/2#27393
Merged
JalonSolov merged 1 commit intoJun 8, 2026
Merged
Conversation
test_server_tls_h2_negotiation asserted that a plain `http.fetch()` (no `enable_http2` field) is served as HTTP/1.1. That held before vlang#27384, but vlang#27384 flipped `enable_http2` to default `true`, so the client now advertises `h2` ALPN by default and the server correctly upgrades — making the test's `resp_h1.version() == .v1_1` assertion fail. This is currently red on master CI (clang/gcc/tcc-linux, clang-macos). The server behavior is correct; the test just needs to opt out explicitly. Pass `enable_http2: false` on the HTTP/1.1 leg, which is what the test means to exercise (server still serves h1 to a client that does not negotiate h2). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
dy-tea
pushed a commit
to wenxuanjun/v
that referenced
this pull request
Jun 19, 2026
…lang#27393) test_server_tls_h2_negotiation asserted that a plain `http.fetch()` (no `enable_http2` field) is served as HTTP/1.1. That held before vlang#27384, but vlang#27384 flipped `enable_http2` to default `true`, so the client now advertises `h2` ALPN by default and the server correctly upgrades — making the test's `resp_h1.version() == .v1_1` assertion fail. This is currently red on master CI (clang/gcc/tcc-linux, clang-macos). The server behavior is correct; the test just needs to opt out explicitly. Pass `enable_http2: false` on the HTTP/1.1 leg, which is what the test means to exercise (server still serves h1 to a client that does not negotiate h2). Co-authored-by: Richard Wheeler <quaesitor.scientiam@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
test_server_tls_h2_negotiation(vlib/net/http/server_tls_test.v) is currently red on master CI — clang-linux, gcc-linux, tcc-linux, clang-macos:The test was written before #27384 and assumed a plain
http.fetch()(noenable_http2field) is served as HTTP/1.1. #27384 flippedenable_http2to defaulttrue, so the client now advertisesh2via ALPN by default and the server correctly upgrades — making the.v1_1assertion fail.Fix
The server behavior is correct; the test just needs to opt out of HTTP/2 explicitly on the leg that means to exercise the HTTP/1.1 path. Pass
enable_http2: falseon theresp_h1fetch (and update the comment to match). The h2 leg above it already passesenable_http2: true, so both directions are now covered explicitly.Verification
v test vlib/net/http/server_tls_test.vpasses;v fmt -verifyclean.🤖 Generated with Claude Code