From 06d5d6831060669b25002e61430f2d15448f0f3a Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 28 Sep 2022 04:27:54 -0400 Subject: [PATCH] avoid timing race in async test This is the test from #27164. The test was checking whether sleep(1) (which is started first) or sleep(0.05) (which is nominally shorter) returned first. Switch the order so that the short sleep should always end first. Fixes #46360 --- test/misc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/misc.jl b/test/misc.jl index 8a0ad13403bcd..a2472cb33871f 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -241,8 +241,8 @@ do_something_async_27164() = @async(begin sleep(1); x27164[] = 2; end) let t = nothing @sync begin - t = do_something_async_27164() @async (sleep(0.05); x27164[] = 1) + t = do_something_async_27164() end @test x27164[] == 1 fetch(t)