Skip to content

Commit 9af1877

Browse files
authored
Merge pull request #39336 from JuliaLang/jb/finalizerenabletest
fix failing `enable_finalizers` test
2 parents 985158f + 43c7d02 commit 9af1877

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/misc.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ for l in (Threads.SpinLock(), ReentrantLock())
149149
@test get_finalizers_inhibited() == 1
150150
GC.enable_finalizers(true)
151151
@test get_finalizers_inhibited() == 0
152-
@test_warn "WARNING: GC finalizers already enabled on this thread." GC.enable_finalizers(true)
152+
if ccall(:jl_is_debugbuild, Cint, ()) != 0
153+
# Note this warning only exists in debug builds
154+
@test_warn "WARNING: GC finalizers already enabled on this thread." GC.enable_finalizers(true)
155+
end
153156

154157
@test lock(l) === nothing
155158
@test try unlock(l) finally end === nothing

0 commit comments

Comments
 (0)