Skip to content

Commit

Permalink
Mark @check_allocs test as broken on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
topolarity committed Oct 8, 2024
1 parent 0aa0854 commit bcd38ab
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ end
# The check should raise errors only for problematic argument types
@check_allocs mymul(x,y) = x * y
@test mymul(1.5, 2.5) == 1.5 * 2.5
@test_throws AllocCheckFailure mymul(rand(10,10), rand(10,10))
if VERSION < v"1.12-DEV"
@test_throws AllocCheckFailure mymul(rand(10,10), rand(10,10))
else
@test_broken false # TODO: investigate segfault above with --check-bounds=yes
end

# If provided, ignore_throw=false should include allocations that
# happen only on error paths
Expand Down Expand Up @@ -220,11 +224,11 @@ end
@test length(check_allocs(Base.mightalias, (Memory{Int},Memory{Int}))) == 0 # uses jl_genericmemory_owner (intercepted)
end

@test any(alloc.type == Base.RefValue{Int} for alloc in check_allocs(()->Ref{Int}(), ()))
@test any((alloc isa AllocationSite && alloc.type == Base.RefValue{Int}) for alloc in check_allocs(()->Ref{Int}(), ()))

allocs1 = check_allocs(()->Ref{Vector{Int64}}(Int64[]), ())
@test any(alloc.type == Base.RefValue{Vector{Int64}} for alloc in allocs1)
@test any(alloc.type == Vector{Int64} for alloc in allocs1)
@test any((alloc isa AllocationSite && alloc.type == Base.RefValue{Vector{Int64}}) for alloc in allocs1)
@test any((alloc isa AllocationSite && alloc.type == Vector{Int64}) for alloc in allocs1)
end

@testset "Error types" begin
Expand Down Expand Up @@ -348,4 +352,4 @@ end
@test x === nothing || x === (1.0, 1.5)
x = foo_with_union_rt((1.0, 1.5))
@test x === nothing || x === (1.0, 1.5)
end
end

0 comments on commit bcd38ab

Please sign in to comment.