chore: fix wait for child process shutdown (#1777)

This commit is contained in:
Marvin Hagemeister
2023-09-15 13:02:44 +02:00
committed by GitHub
parent e59472e35a
commit 32ee75dee5
4 changed files with 7 additions and 3 deletions
+1
View File
@@ -41,6 +41,7 @@ Deno.test({
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
await serverProcess.status;
}, },
sanitizeOps: false, sanitizeOps: false,
sanitizeResources: false, sanitizeResources: false,
+4
View File
@@ -758,6 +758,7 @@ Deno.test("jsx pragma works", {
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
await serverProcess.status;
}); });
Deno.test("preact/debug is active in dev mode", { Deno.test("preact/debug is active in dev mode", {
@@ -795,6 +796,7 @@ Deno.test("preact/debug is active in dev mode", {
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
await serverProcess.status;
}); });
Deno.test("preloading javascript files", { Deno.test("preloading javascript files", {
@@ -843,6 +845,7 @@ Deno.test("preloading javascript files", {
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
await serverProcess.status;
} }
}); });
@@ -865,6 +868,7 @@ Deno.test("PORT environment variable", {
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
await serverProcess.status;
}); });
Deno.test("throw on route export 'handlers' instead of 'handler'", { Deno.test("throw on route export 'handlers' instead of 'handler'", {
+1
View File
@@ -124,6 +124,7 @@ Deno.test({
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
await serverProcess.status;
}, },
sanitizeOps: false, sanitizeOps: false,
sanitizeResources: false, sanitizeResources: false,
+1 -3
View File
@@ -1,5 +1,4 @@
import { assertArrayIncludes, assertEquals } from "$std/testing/asserts.ts"; import { assertArrayIncludes, assertEquals } from "$std/testing/asserts.ts";
import { delay } from "$std/async/delay.ts";
import { startFreshServer, withPageName } from "../tests/test_utils.ts"; import { startFreshServer, withPageName } from "../tests/test_utils.ts";
import { dirname, join } from "$std/path/mod.ts"; import { dirname, join } from "$std/path/mod.ts";
import VERSIONS from "../versions.json" assert { type: "json" }; import VERSIONS from "../versions.json" assert { type: "json" };
@@ -20,8 +19,7 @@ Deno.test("CORS should not set on GET /fresh-badge.svg", {
await lines.cancel(); await lines.cancel();
serverProcess.kill("SIGTERM"); serverProcess.kill("SIGTERM");
// await for the server to close await serverProcess.status;
await delay(100);
}); });
Deno.test("shows version selector", { Deno.test("shows version selector", {