Compare commits

...

1 Commits

Author SHA1 Message Date
Claude Bot
0b5f5deea5 fix(test): fix flaky HTTP/2 settings test by using local server
The "settings and properties should work" test was connecting to
https://www.example.com, which sometimes doesn't negotiate HTTP/2
via ALPN, causing intermittent "h2 is not supported" errors.

Changed the test to use the local HTTPS_SERVER with TLS_OPTIONS,
which is guaranteed to support HTTP/2 and eliminates external
network dependencies. Also relaxed the :authority header check
to just validate it's a string rather than an exact match, since
the local server's hostname/port varies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-10 00:42:51 +00:00

View File

@@ -797,7 +797,7 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) {
expect(typeof settings.maxHeaderSize).toBe("number");
};
const { promise, resolve, reject } = Promise.withResolvers();
const client = http2.connect("https://www.example.com");
const client = http2.connect(HTTPS_SERVER, TLS_OPTIONS);
client.on("error", reject);
expect(client.connecting).toBeTrue();
expect(client.alpnProtocol).toBeUndefined();
@@ -816,12 +816,11 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) {
expect(req.pending).toBeFalse();
expect(typeof req.id).toBe("number");
expect(req.session).toBeDefined();
expect(req.sentHeaders).toEqual({
":authority": "www.example.com",
":method": "GET",
":path": "/",
":scheme": "https",
});
// Check that sent headers have correct structure
expect(req.sentHeaders[":method"]).toBe("GET");
expect(req.sentHeaders[":path"]).toBe("/");
expect(req.sentHeaders[":scheme"]).toBe("https");
expect(typeof req.sentHeaders[":authority"]).toBe("string");
expect(req.sentTrailers).toBeUndefined();
expect(req.sentInfoHeaders.length).toBe(0);
expect(req.scheme).toBe("https");