Skip to content

Commit 4d03633

Browse files
don't retain value in Pass for DefaultTestSet
1 parent f9a3f64 commit 4d03633

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/Test/src/Test.jl

+4-1
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,10 @@ record(ts::DefaultTestSet, t::Broken) = (push!(ts.results, t); t)
11081108
# `record_passes()` is true. i.e. set env var `JULIA_TEST_RECORD_PASSES=true` before running any testsets
11091109
function record(ts::DefaultTestSet, t::Pass)
11101110
ts.n_passed += 1
1111-
record_passes() && push!(ts.results, t)
1111+
if record_passes()
1112+
# throw away the value so it can be GC-ed
1113+
t_novalue = Pass(t.test_type, t.orig_expr, t.data, nothing, t.source, t.message_only)
1114+
push!(ts.results, t_novalue)
11121115
return t
11131116
end
11141117

0 commit comments

Comments
 (0)