Skip to content

Commit e109480

Browse files
committed
fixup! tests: Test DTaskFailedException inner type
1 parent e6f2305 commit e109480

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/scheduler.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ end
182182
@testset "allow errors" begin
183183
opts = ThunkOptions(;allow_errors=true)
184184
a = delayed(error; options=opts)("Test")
185-
@test_throws_unwrap Dagger.DTaskFailedException collect(a)
185+
@test_throws_unwrap (Dagger.DTaskFailedException, ErrorException) collect(a)
186186
end
187187
end
188188

@@ -396,7 +396,7 @@ end
396396
([Dagger.tochunk(MyStruct(1)), Dagger.tochunk(1)], sizeof(MyStruct)+sizeof(Int)),
397397
]
398398
for arg in args
399-
if arg isa Chunk
399+
if arg isa Dagger.Chunk
400400
aff = Dagger.affinity(arg)
401401
@test aff[1] == OSProc(1)
402402
@test aff[2] == MemPool.approx_size(MemPool.poolget(arg.handle))
@@ -477,7 +477,7 @@ end
477477
@test res == 2
478478
@testset "self as input" begin
479479
a = delayed(dynamic_add_thunk_self_dominated)(1)
480-
@test_throws_unwrap Dagger.Sch.DynamicThunkException reason="Cannot fetch result of dominated thunk" collect(Context(), a)
480+
@test_throws_unwrap (RemoteException, Dagger.Sch.DynamicThunkException) reason="Cannot fetch result of dominated thunk" collect(Context(), a)
481481
end
482482
end
483483
@testset "Fetch/Wait" begin
@@ -487,11 +487,11 @@ end
487487
end
488488
@testset "self" begin
489489
a = delayed(dynamic_fetch_self)(1)
490-
@test_throws_unwrap Dagger.Sch.DynamicThunkException reason="Cannot fetch own result" collect(Context(), a)
490+
@test_throws_unwrap (RemoteException, Dagger.Sch.DynamicThunkException) reason="Cannot fetch own result" collect(Context(), a)
491491
end
492492
@testset "dominated" begin
493493
a = delayed(identity)(delayed(dynamic_fetch_dominated)(1))
494-
@test_throws_unwrap Dagger.Sch.DynamicThunkException reason="Cannot fetch result of dominated thunk" collect(Context(), a)
494+
@test_throws_unwrap (RemoteException, Dagger.Sch.DynamicThunkException) reason="Cannot fetch result of dominated thunk" collect(Context(), a)
495495
end
496496
end
497497
end
@@ -540,7 +540,7 @@ end
540540
t = Dagger.@spawn scope=Dagger.scope(worker=1, thread=1) sleep(100)
541541
start_time = time_ns()
542542
Dagger.cancel!(t)
543-
@test_throws_unwrap Dagger.DTaskFailedException fetch(t)
543+
@test_throws_unwrap (Dagger.DTaskFailedException, InterruptException) fetch(t)
544544
t = Dagger.@spawn scope=Dagger.scope(worker=1, thread=1) yield()
545545
fetch(t)
546546
finish_time = time_ns()

test/util.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ function _test_throws_unwrap(terr, ex; to_match=[])
1818
match_expr = Expr(:block)
1919
for m in to_match
2020
if m.head == :(=)
21-
lhs, rhs = replace_obj!(m.args[1], oerr), m.args[2]
21+
lhs, rhs = replace_obj!(m.args[1], rerr), m.args[2]
2222
push!(match_expr.args, :(@test $lhs == $rhs))
2323
elseif m.head == :call
2424
fn = m.args[1]
25-
lhs, rhs = replace_obj!(m.args[2], oerr), m.args[3]
25+
lhs, rhs = replace_obj!(m.args[2], rerr), m.args[3]
2626
if fn == :(<)
2727
push!(match_expr.args, :(@test startswith($lhs, $rhs)))
2828
elseif fn == :(>)

0 commit comments

Comments
 (0)