Skip to content

Commit

Permalink
Make loopback test less flaky by using Event instead of sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Dec 20, 2022
1 parent 2fe988b commit d59f8ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/loopback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -278,6 +279,7 @@ end
startread(http)
body = read(http)
closeread(http)
notify(event)
end
end
end
Expand Down

0 comments on commit d59f8ae

Please sign in to comment.