Skip to content

Commit

Permalink
Deflake
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Dec 26, 2024
1 parent d8a6af2 commit 59b0f59
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/js/web/fetch/fetch-leak.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("fetch doesn't leak", () => {
var count = 0;
using server = Bun.serve({
port: 0,

idleTimeout: 0,
fetch(req) {
count++;
return new Response(body);
Expand All @@ -20,7 +20,7 @@ describe("fetch doesn't leak", () => {
const proc = Bun.spawn({
env: {
...bunEnv,
SERVER: `http://${server.hostname}:${server.port}`,
SERVER: server.url.href,
COUNT: "200",
},
stderr: "inherit",
Expand Down Expand Up @@ -49,6 +49,7 @@ describe("fetch doesn't leak", () => {

const serveOptions = {
port: 0,
idleTimeout: 0,
fetch(req) {
return new Response(body, { headers });
},
Expand All @@ -62,8 +63,8 @@ describe("fetch doesn't leak", () => {

const env = {
...bunEnv,
SERVER: `${tls ? "https" : "http"}://${server.hostname}:${server.port}`,
BUN_JSC_forceRAMSize: (1024 * 1024 * 64).toString("10"),
SERVER: server.url.href,
BUN_JSC_forceRAMSize: (1024 * 1024 * 64).toString(10),
NAME: name,
};

Expand Down Expand Up @@ -105,6 +106,7 @@ describe.each(["FormData", "Blob", "Buffer", "String", "URLSearchParams", "strea
async () => {
using server = Bun.serve({
port: 0,
idleTimeout: 0,
fetch(req) {
return new Response();
},
Expand Down Expand Up @@ -151,7 +153,7 @@ test("do not leak", async () => {

let url;
let isDone = false;
server.listen(0, function attack() {
server.listen(0, "127.0.0.1", function attack() {
if (isDone) {
return;
}
Expand Down

0 comments on commit 59b0f59

Please sign in to comment.