File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 311311 @test contains (str, " Malt.TerminatedWorkerException" )
312312end
313313
314+ @testset " worker task failure detected by monitor" begin
315+ testsuite = Dict (
316+ " a" => :( @test true ),
317+ )
318+
319+ exception = ErrorException (" test_worker exploded" )
320+ # A bad test_worker will cause the worker task to error out. With this test
321+ # we want to make sure the task monitoring system catches and handles it.
322+ test_worker (name) = throw (exception)
323+
324+ io = IOBuffer ()
325+ try
326+ runtests (ParallelTestRunner, [" --jobs=1" ];
327+ test_worker, testsuite, stdout = io, stderr = io)
328+ # The `runtests` above should handle the error, so we shouldn't get here
329+ @test false
330+ catch e
331+ @test typeof (e) === TaskFailedException
332+ @test first (Base. current_exceptions (e. task)). exception == exception
333+ end
334+ str = String (take! (io))
335+ @test contains (str, " Caught an error, stopping..." )
336+ @test ! contains (str, " SUCCESS" )
337+ # Not even FAILURE is printed in this case, we exit very early.
338+ @test ! contains (str, " FAILURE" )
339+ end
340+
314341@testset " test output" begin
315342 msg = " This is some output from the test"
316343 testsuite = Dict (
You can’t perform that action at this time.
0 commit comments