From d59f8ae6cb52292631a6664eb6ed0d3e844f6b6c Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Tue, 20 Dec 2022 12:37:58 -0700 Subject: [PATCH] Make loopback test less flaky by using Event instead of sleep --- test/loopback.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/loopback.jl b/test/loopback.jl index 50aeddf43..5f5bdd75c 100644 --- a/test/loopback.jl +++ b/test/loopback.jl @@ -262,8 +262,9 @@ end @test_throws HTTP.StatusError begin r = lbopen("abort", []) do http @sync begin + event = Base.Event() @async try - sleep(0.1) + wait(event) write(http, "Hello World!") closewrite(http) body_sent = true @@ -278,6 +279,7 @@ end startread(http) body = read(http) closeread(http) + notify(event) end end end