Skip to content

Commit 6f4048b

Browse files
committed
Try to fix tests on nightly
1 parent d2789f0 commit 6f4048b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/runtests.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
using Test, StableTasks
22
using StableTasks: @spawn, @spawnat, @fetch, @fetchfrom
33

4+
if isdefinded(Threads, :maxthreadid)
5+
maxthreadid() = Threads.maxthreadid()
6+
else
7+
maxthreadid() = Threads.nthreads()
8+
end
9+
410
@testset "Type stability" begin
511
@test 2 == @inferred fetch(@spawn 1 + 1)
612
t = @eval @spawn inv([1 2 ; 3 4])
@@ -16,7 +22,7 @@ using StableTasks: @spawn, @spawnat, @fetch, @fetchfrom
1622
@test inv([1 2 ; 3 4]) == @inferred fetch(t)
1723

1824
@test 2 == @inferred fetch(@spawnat 1 1 + 1)
19-
t = @eval @spawnat 1 inv([1 2 ; 3 4])
25+
t = @eval @spawnat maxthreadid() inv([1 2 ; 3 4])
2026
@test inv([1 2 ; 3 4]) == @inferred fetch(t)
2127
end
2228

0 commit comments

Comments
 (0)