diff --git a/test/threads.jl b/test/threads.jl index 3ed73b67793f0..fba1bbede9b20 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -174,9 +174,11 @@ close(proc.in) # Not using threads_exec.jl for better isolation, reproducibility, and a # tighter timeout. script = "profile_spawnmany_exec.jl" - cmd = `$(Base.julia_cmd()) --depwarn=error --rr-detach --startup-file=no $script` + cmd_base = `$(Base.julia_cmd()) --depwarn=error --rr-detach --startup-file=no $script` @testset for n in [20000, 200000, 2000000] - proc = run(ignorestatus(setenv(cmd, "NTASKS" => n; dir = @__DIR__)); wait = false) + cmd = ignorestatus(setenv(cmd_base, "NTASKS" => n; dir = @__DIR__)) + cmd = pipeline(cmd; stdout = stderr, stderr) + proc = run(cmd; wait = false) done = Threads.Atomic{Bool}(false) timeout = false timer = Timer(100) do _ @@ -200,7 +202,15 @@ close(proc.in) done[] = true close(timer) end - @test success(proc) + if ( !success(proc) ) || ( timeout ) + @error "A \"spawn and wait lots of tasks\" test failed" n proc.exitcode proc.termsignal success(proc) timeout + end + if Sys.iswindows() + # Known failure: https://github.com/JuliaLang/julia/issues/43124 + @test_skip success(proc) + else + @test success(proc) + end @test !timeout end end