Skip to content

Commit 3e44b95

Browse files
JeffBezansonKristofferC
authored andcommitted
fix failing enable_finalizers test
(cherry picked from commit 43c7d02)
1 parent cf0c32f commit 3e44b95

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)