File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 7171 t = TASKS[tid]
7272 if istaskfailed (t)
7373 initialize_task (tid)
74- return true
74+ throw ( TaskFailedException (t))
7575 end
7676 yield ()
7777 false
9090 end
9191 false
9292end
93-
Original file line number Diff line number Diff line change 7777 @test ThreadingUtilities. load (pointer (x), ThreadingUtilities. ThreadState) ==
7878 ThreadingUtilities. SPIN
7979 end
80+ # Make all tasks error
8081 for tid ∈ eachindex (ThreadingUtilities. TASKS)
8182 launch_thread_copy! (tid, Float64[], Float64[])
8283 end
8384 sleep (1 )
8485 @test all (istaskfailed, ThreadingUtilities. TASKS)
85- @test all (ThreadingUtilities. wait, eachindex (ThreadingUtilities. TASKS))
86+ # Test that `wait` reports the error for each task
87+ for tid in eachindex (ThreadingUtilities. TASKS)
88+ @test_throws TaskFailedException ThreadingUtilities. wait (tid)
89+ end
90+ # Test that none of the tasks are in the failed state
8691 @test ! any (istaskfailed, ThreadingUtilities. TASKS)
8792 # test copy on the reinitialized tasks
8893 foreach (test_copy, eachindex (ThreadingUtilities. TASKS))
8994end
90-
You can’t perform that action at this time.
0 commit comments