File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 71
71
t = TASKS[tid]
72
72
if istaskfailed (t)
73
73
initialize_task (tid)
74
- return true
74
+ throw ( TaskFailedException (t))
75
75
end
76
76
yield ()
77
77
false
90
90
end
91
91
false
92
92
end
93
-
Original file line number Diff line number Diff line change 77
77
@test ThreadingUtilities. load (pointer (x), ThreadingUtilities. ThreadState) ==
78
78
ThreadingUtilities. SPIN
79
79
end
80
+ # Make all tasks error
80
81
for tid ∈ eachindex (ThreadingUtilities. TASKS)
81
82
launch_thread_copy! (tid, Float64[], Float64[])
82
83
end
83
84
sleep (1 )
84
85
@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
86
91
@test ! any (istaskfailed, ThreadingUtilities. TASKS)
87
92
# test copy on the reinitialized tasks
88
93
foreach (test_copy, eachindex (ThreadingUtilities. TASKS))
89
94
end
90
-
You can’t perform that action at this time.
0 commit comments