mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
test: ignore fetchWithInvalidContentLength and fetchConnectionError on Windows (#18351)
https://github.com/denoland/deno/issues/18350
This commit is contained in:
parent
fd0658fb42
commit
2ac2906b2b
1 changed files with 33 additions and 50 deletions
|
@ -54,30 +54,11 @@ function findClosedPortInRange(
|
|||
);
|
||||
}
|
||||
|
||||
function flakyTest(
|
||||
fn: (t: Deno.TestContext) => Promise<void>,
|
||||
) {
|
||||
async function wrapperFn(t: Deno.TestContext) {
|
||||
let lastError;
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
try {
|
||||
await fn(t);
|
||||
return;
|
||||
} catch (e) {
|
||||
lastError = e;
|
||||
}
|
||||
}
|
||||
|
||||
throw lastError;
|
||||
}
|
||||
Object.defineProperty(wrapperFn, "name", { value: fn.name });
|
||||
return wrapperFn;
|
||||
}
|
||||
|
||||
Deno.test(
|
||||
{ permissions: { net: true } },
|
||||
flakyTest(async function fetchConnectionError() {
|
||||
// TODO(bartlomieju): reenable this test
|
||||
// https://github.com/denoland/deno/issues/18350
|
||||
{ ignore: Deno.build.os === "windows", permissions: { net: true } },
|
||||
async function fetchConnectionError() {
|
||||
const port = findClosedPortInRange(4000, 9999);
|
||||
await assertRejects(
|
||||
async () => {
|
||||
|
@ -86,7 +67,7 @@ Deno.test(
|
|||
TypeError,
|
||||
"error trying to connect",
|
||||
);
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
Deno.test(
|
||||
|
@ -1697,7 +1678,6 @@ function invalidServer(addr: string, body: Uint8Array): Deno.Listener {
|
|||
|
||||
Deno.test(
|
||||
{ permissions: { net: true } },
|
||||
flakyTest(
|
||||
async function fetchWithInvalidContentLengthAndTransferEncoding(): Promise<
|
||||
void
|
||||
> {
|
||||
|
@ -1724,11 +1704,12 @@ Deno.test(
|
|||
|
||||
listener.close();
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Deno.test(
|
||||
{ permissions: { net: true } },
|
||||
// TODO(bartlomieju): reenable this test
|
||||
// https://github.com/denoland/deno/issues/18350
|
||||
{ ignore: Deno.build.os === "windows", permissions: { net: true } },
|
||||
async function fetchWithInvalidContentLength(): Promise<
|
||||
void
|
||||
> {
|
||||
|
@ -1867,7 +1848,9 @@ Deno.test(
|
|||
);
|
||||
|
||||
Deno.test(
|
||||
{ permissions: { net: true } },
|
||||
// TODO(bartlomieju): reenable this 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 server = (async () => {
|
||||
|
|
Loading…
Reference in a new issue