mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 16:42:21 -05:00
enable test of aborted conn on windows (denoland/deno_std#549)
Original: 28ae08b424
This commit is contained in:
parent
b76007d25c
commit
b1e5ad7eca
1 changed files with 8 additions and 10 deletions
|
@ -461,10 +461,6 @@ test({
|
||||||
test({
|
test({
|
||||||
name: "[http] destroyed connection",
|
name: "[http] destroyed connection",
|
||||||
async fn(): Promise<void> {
|
async fn(): Promise<void> {
|
||||||
// TODO: don't skip on windows when process.kill is implemented on windows.
|
|
||||||
if (Deno.build.os === "win") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Runs a simple server as another process
|
// Runs a simple server as another process
|
||||||
const p = Deno.run({
|
const p = Deno.run({
|
||||||
args: [Deno.execPath, "http/testdata/simple_server.ts", "--allow-net"],
|
args: [Deno.execPath, "http/testdata/simple_server.ts", "--allow-net"],
|
||||||
|
@ -477,11 +473,13 @@ test({
|
||||||
assert(s !== Deno.EOF && s.includes("server listening"));
|
assert(s !== Deno.EOF && s.includes("server listening"));
|
||||||
|
|
||||||
let serverIsRunning = true;
|
let serverIsRunning = true;
|
||||||
p.status().then(
|
p.status()
|
||||||
(): void => {
|
.then(
|
||||||
serverIsRunning = false;
|
(): void => {
|
||||||
}
|
serverIsRunning = false;
|
||||||
);
|
}
|
||||||
|
)
|
||||||
|
.catch((_): void => {}); // Ignores the error when closing the process.
|
||||||
|
|
||||||
await delay(100);
|
await delay(100);
|
||||||
|
|
||||||
|
@ -496,7 +494,7 @@ test({
|
||||||
assert(serverIsRunning);
|
assert(serverIsRunning);
|
||||||
} finally {
|
} finally {
|
||||||
// Stops the sever.
|
// Stops the sever.
|
||||||
p.kill(Deno.Signal.SIGINT);
|
p.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue