Skip to content

Commit

Permalink
chore(cli): Reduce port conflict in tests (#19988)
Browse files Browse the repository at this point in the history
Ports are still occasionally causing CI flake -- allocate and separate
ports further for fetch/http tests.
  • Loading branch information
mmastrac authored Jul 31, 2023
1 parent 2fd8747 commit 43877f1
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 102 deletions.
6 changes: 3 additions & 3 deletions cli/tests/unit/fetch_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "./test_util.ts";
import { Buffer } from "../../../test_util/std/io/buffer.ts";

const listenPort = 4504;
const listenPort = 4506;

Deno.test(
{ permissions: { net: true } },
Expand Down Expand Up @@ -1909,7 +1909,7 @@ Deno.test(
// https://github.com/denoland/deno/issues/18350
{ ignore: Deno.build.os === "windows", permissions: { net: true } },
async function fetchRequestBodyErrorCatchable() {
const listener = Deno.listen({ hostname: "127.0.0.1", port: 4514 });
const listener = Deno.listen({ hostname: "127.0.0.1", port: listenPort });
const server = (async () => {
const conn = await listener.accept();
listener.close();
Expand All @@ -1936,7 +1936,7 @@ Deno.test(
});

const err = await assertRejects(() =>
fetch("http://localhost:4514", {
fetch(`http://localhost:${listenPort}/`, {
body: stream,
method: "POST",
})
Expand Down
Loading

0 comments on commit 43877f1

Please sign in to comment.