diff --git a/tests/unit_node/http2_test.ts b/tests/unit_node/http2_test.ts index 8e7a525da9455c..c76e38f6fc04be 100644 --- a/tests/unit_node/http2_test.ts +++ b/tests/unit_node/http2_test.ts @@ -158,5 +158,5 @@ Deno.test("[node/http2.createServer()]", async () => { server.close(); // Wait to avoid leaking the timer from here // https://github.com/denoland/deno/blob/749b6e45e58ac87188027f79fe403d130f86bd73/ext/node/polyfills/net.ts#L2396-L2402 - await new Promise((resolve) => server.on("close", resolve)); + await new Promise((resolve) => setTimeout(resolve, 20)); });