Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions test/js/bun/http/serve-http3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,18 +1016,21 @@ describe("Bun.serve HTTP/3 lifecycle", () => {
`;
await withCustomServer(script, async (port, send, waitForStderr) => {
expect(await fetchH3(port, "/").then(r => r.text())).toBe("ok");
const inflight = fetchH3(port, "/stop", {
// The rejection can reach this thread before the STOPPED line does, so
// the handlers are on the promise before the wait.
const outcome = fetchH3(port, "/stop", {
method: "POST",
body: new ReadableStream({
start(c) {
c.enqueue("payload");
c.close();
},
}),
});
})
.then(r => r.text())
.catch(e => e.code);
await waitForStderr(/STOPPED/);
const outcome = await inflight.then(r => r.text()).catch(e => e.code);
expect(outcome).toBe("HTTP3StreamReset");
expect(await outcome).toBe("HTTP3StreamReset");
});
});

Expand Down
Loading