From af47c06541d33fb8e0d46477060cab4a63981c10 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 15 May 2024 08:37:46 -0400 Subject: [PATCH] chore: fix flaky '[node/http] send request with non-chunked body' test (#23818) https://github.com/denoland/deno/actions/runs/9086887959/job/24973565321 --- tests/unit_node/http_test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index c298f2abb2..c57027549c 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -380,7 +380,12 @@ Deno.test("[node/http] send request with non-chunked body", async () => { req.write("world"); req.end(); - await servePromise; + await Promise.all([ + servePromise, + // wait 100ms because of the socket.setTimeout(100) above + // in order to not cause a flaky test sanitizer failure + await new Promise((resolve) => setTimeout(resolve, 100)), + ]); }); Deno.test("[node/http] send request with chunked body", async () => {