summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2019-07-30 16:39:32 +0900
committerRyan Dahl <ry@tinyclouds.org>2019-07-30 07:39:32 +0000
commitb1e5ad7eca8a1c6e38bb326daee9775b41687cf9 (patch)
tree561450fa2fa99b1d7ff30e75adac48f06e0d085c
parentb76007d25caf2cd9325813149a907c1e51728fca (diff)
enable test of aborted conn on windows (denoland/deno_std#549)
Original: https://github.com/denoland/deno_std/commit/28ae08b4244cda59379e25b523c3490edbaa7ce2
-rw-r--r--http/server_test.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/http/server_test.ts b/http/server_test.ts
index da1a08dc0..9768ccdf4 100644
--- a/http/server_test.ts
+++ b/http/server_test.ts
@@ -461,10 +461,6 @@ test({
test({
name: "[http] destroyed connection",
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
const p = Deno.run({
args: [Deno.execPath, "http/testdata/simple_server.ts", "--allow-net"],
@@ -477,11 +473,13 @@ test({
assert(s !== Deno.EOF && s.includes("server listening"));
let serverIsRunning = true;
- p.status().then(
- (): void => {
- serverIsRunning = false;
- }
- );
+ p.status()
+ .then(
+ (): void => {
+ serverIsRunning = false;
+ }
+ )
+ .catch((_): void => {}); // Ignores the error when closing the process.
await delay(100);
@@ -496,7 +494,7 @@ test({
assert(serverIsRunning);
} finally {
// Stops the sever.
- p.kill(Deno.Signal.SIGINT);
+ p.close();
}
}
});