Skip to content

Commit 02a2c4d

Browse files
authored
More stuff
1 parent 53436f8 commit 02a2c4d

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

test/error_path_manager_timeout.jl

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
function unwrap_task_failed_ex(outer_ex::TaskFailedException)
2+
end
3+
14
mktempdir() do tmpdir
25
fake_bindir = joinpath(tmpdir, "bin")
36
fake_srun = joinpath(tmpdir, "bin", "srun")
@@ -33,9 +36,24 @@ mktempdir() do tmpdir
3336
@info "with old PATH" Sys.which("srun")
3437
withenv(new_env...) do
3538
@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
4058
end
4159
end

0 commit comments

Comments
 (0)