|
| 1 | +function unwrap_task_failed_ex(outer_ex::TaskFailedException) |
| 2 | +end |
| 3 | + |
1 | 4 | mktempdir() do tmpdir
|
2 | 5 | fake_bindir = joinpath(tmpdir, "bin")
|
3 | 6 | fake_srun = joinpath(tmpdir, "bin", "srun")
|
@@ -33,9 +36,24 @@ mktempdir() do tmpdir
|
33 | 36 | @info "with old PATH" Sys.which("srun")
|
34 | 37 | withenv(new_env...) do
|
35 | 38 | @info "with new PATH" Sys.which("srun")
|
36 |
| - # expected_ex = ErrorException("launch_timeout exceeded") |
37 |
| - expected_ex = ErrorException("Hello world!") |
38 |
| - mgr = SlurmClusterManager.SlurmManager(; launch_timeout = 2.0) # 2.0 seconds |
39 |
| - @test_throws expected_ex Distributed.addprocs(mgr) |
| 39 | + expected_outer_ex_T = TaskFailedException |
| 40 | + expected_inner_ex_T = ErrorException |
| 41 | + expected_inner_ex_INSTANCE = ErrorException("launch_timeout exceeded") |
| 42 | + mgr = SlurmClusterManager.SlurmManager(; launch_timeout = 2.0) |
| 43 | + observed_outer_ex = @test_throws expected_ex Distributed.addprocs(mgr) |
| 44 | + @info "" observed_outer_ex # TODO: Delete this line |
| 45 | + @show dump(observed_outer_ex) # TODO: Delete this line |
| 46 | + @test observed_outer_ex isa expected_outer_ex_T |
| 47 | + if Base.VERSION >= v"1.1" |
| 48 | + observed_inner_ex = unwrap_task_failed_ex(observed_outer_ex) |
| 49 | + @info "" observed_inner_ex # TODO: Delete this line |
| 50 | + @show dump(observed_inner_ex) # TODO: Delete this line |
| 51 | + @test observed_inner_ex isa expected_inner_ex_T |
| 52 | + @test observed_inner_ex == expected_inner_ex_INSTANCE |
| 53 | + else |
| 54 | + @warn "Skipping some tests on Julia 1.0.x" Base.VERSION |
| 55 | + @test_skip false |
| 56 | + end |
| 57 | + @show observed_ex.task |
40 | 58 | end
|
41 | 59 | end
|
0 commit comments