Skip to content

Commit

Permalink
Improve fixture test stability (#4509)
Browse files Browse the repository at this point in the history
* set --inspector-port=0
for all fixture tests which already set --port=0

* increase run-long-lived-wrangler timeout
  • Loading branch information
RamIdeas committed Nov 24, 2023
1 parent d8b5a01 commit 61ec986
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fixtures/additional-modules/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("find_additional_modules dev", () => {
path.join(tmpDir, "wrangler.toml")
);

worker = await runWranglerDev(tmpDir, ["--port=0"]);
worker = await runWranglerDev(tmpDir, ["--port=0", "--inspector-port=0"]);
});
afterAll(async () => {
await worker.stop();
Expand Down
1 change: 1 addition & 0 deletions fixtures/external-durable-objects-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe.skip("Pages Functions", () => {
"public",
"--do=PAGES_REFERENCED_DO=MyDurableObject@a",
"--port=0",
"--inspector-port=0",
],
{
stdio: ["ignore", "ignore", "ignore", "ipc"],
Expand Down
1 change: 1 addition & 0 deletions fixtures/import-wasm-example/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe("wrangler correctly imports wasm files with npm resolution", () => {
beforeAll(async () => {
({ ip, port, stop } = await runWranglerDev(resolve(__dirname, ".."), [
"--port=0",
"--inspector-port=0",
]));
});

Expand Down
2 changes: 1 addition & 1 deletion fixtures/node-app-pages/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages Dev", () => {
const { ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--node-compat", "--port=0"]
["--node-compat", "--port=0", "--inspector-port=0"]
);
try {
const response = await fetch(`http://${ip}:${port}/stripe`);
Expand Down
1 change: 1 addition & 0 deletions fixtures/pages-functions-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("Pages Functions", () => {
"--binding=OTHER_NAME=THING=WITH=EQUALS",
"--r2=BUCKET",
"--port=0",
"--inspector-port=0",
]
));
});
Expand Down
2 changes: 1 addition & 1 deletion fixtures/pages-functions-wasm-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages Functions with wasm module imports", () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages Functions with custom _routes.json", () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Pages Functions", () => {
({ ip, port, stop } = await runWranglerPagesDev(
path.resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
2 changes: 1 addition & 1 deletion fixtures/pages-simple-assets/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages Functions", async () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages project with `_worker.js` and `/functions` directory", () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
4 changes: 2 additions & 2 deletions fixtures/pages-workerjs-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("Pages _worker.js", () => {
const { ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"./workerjs-test",
["--no-bundle=false", "--port=0"]
["--no-bundle=false", "--port=0", "--inspector-port=0"]
);
try {
await expect(
Expand All @@ -50,7 +50,7 @@ describe("Pages _worker.js", () => {
const { ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"./workerjs-test",
["--bundle", "--port=0"]
["--bundle", "--port=0", "--inspector-port=0"]
);
try {
await expect(
Expand Down
1 change: 1 addition & 0 deletions fixtures/pages-workerjs-directory/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("Pages _worker.js/ directory", () => {
"public",
[
"--port=0",
"--inspector-port=0",
`--persist-to=${tmpDir}`,
"--d1=D1",
"--d1=PUT=elsewhere",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/pages-workerjs-wasm-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages Advanced Mode with wasm module imports", () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Pages Advanced Mode with custom _routes.json", () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
10 changes: 9 additions & 1 deletion fixtures/pages-ws-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ describe.skip("Pages Functions", () => {
});
wranglerProcess = fork(
path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"),
["pages", "dev", "--port=0", "--proxy=8791", "--", "pnpm run server"],
[
"pages",
"dev",
"--port=0",
"--inspector-port=0",
"--proxy=8791",
"--",
"pnpm run server",
],
{
cwd: path.resolve(__dirname, ".."),
}
Expand Down
2 changes: 1 addition & 1 deletion fixtures/remix-pages-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Remix", () => {
({ ip, port, stop } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
["--port=0"]
["--port=0", "--inspector-port=0"]
));
});

Expand Down
2 changes: 1 addition & 1 deletion fixtures/shared/src/run-wrangler-long-lived.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function runLongLivedWrangler(command: string[], cwd: string) {
separator,
].join("\n");
rejectReadyPromise(new Error(message));
}, 10_000);
}, 20_000);

async function stop() {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion fixtures/worker-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("'wrangler dev' correctly renders pages", () => {
beforeAll(async () => {
({ ip, port, stop, getOutput } = await runWranglerDev(
resolve(__dirname, ".."),
["--local", "--port=0"]
["--local", "--port=0", "--inspector-port=0"]
));
});

Expand Down

0 comments on commit 61ec986

Please sign in to comment.