From 80c5ba32b5d238e8cac3a0aa253ac1543ed114f3 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 11 Jan 2021 15:55:12 -0600 Subject: [PATCH] Remove wait from CI testing for networking tests. We want to expose any existing race conditions. --- test/suite0009.janet | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test/suite0009.janet b/test/suite0009.janet index a8e2f8f9..999af128 100644 --- a/test/suite0009.janet +++ b/test/suite0009.janet @@ -36,12 +36,6 @@ (def s (net/server "127.0.0.1" "8000" handler)) (assert s "made server 1") -# We need some sleep for windows to let the server stabilize -# or else the first read can fail. Might be a strange windows -# "bug", but needs further investigating. Otherwise, `build_win test` -# can sometimes fail on windows, leading to flaky testing. -(ev/sleep 0.3) - (defn test-echo [msg] (with [conn (net/connect "127.0.0.1" "8000")] (:write conn msg) @@ -59,7 +53,6 @@ (var pipe-counter 0) (def chan (ev/chan 10)) (let [[reader writer] (os/pipe)] - (ev/sleep 0.3) (ev/spawn (while (ev/read reader 3) (++ pipe-counter)) @@ -73,13 +66,13 @@ (ev/take chan)) (var result nil) -(def fiber +(var fiber nil) +(set fiber (ev/spawn - (set result (protect (ev/sleep 0.4))) + (set result (protect (ev/sleep 10))) (assert (= result '(false "boop")) "ev/cancel 1"))) -(ev/sleep 0.1) +(ev/sleep 0) (ev/cancel fiber "boop") -(ev/sleep 0.1) (assert-error "bad arity to ev/call" (ev/call inc 1 2 3))