Skip to content

Commit cb75d49

Browse files
JeffBezansonvchuravy
authored andcommitted
fix failing enable_finalizers test
(cherry picked from commit 43c7d02)
1 parent 1c3326f commit cb75d49

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
@@ -136,7 +136,10 @@ for l in (Threads.SpinLock(), ReentrantLock())
136136
@test get_finalizers_inhibited() == 1
137137
GC.enable_finalizers(true)
138138
@test get_finalizers_inhibited() == 0
139-
@test_warn "WARNING: GC finalizers already enabled on this thread." GC.enable_finalizers(true)
139+
if ccall(:jl_is_debugbuild, Cint, ()) != 0
140+
# Note this warning only exists in debug builds
141+
@test_warn "WARNING: GC finalizers already enabled on this thread." GC.enable_finalizers(true)
142+
end
140143

141144
@test lock(l) === nothing
142145
@test try unlock(l) finally end === nothing

0 commit comments

Comments
 (0)