Make GC between test items opt-in - #121
Merged
Merged
Conversation
`execute_testrun` used to run `GC.gc(true)` after every test item whenever a run used more than one test process, to match ReTestItems. Measured on JuliaWorkspaces.jl CI it did not pay for itself: the test phase was slower in 15 of 18 legs (1.26x at the median), process RSS was unchanged, and on 7 GB macOS arm64 runners each full collection took 40-75 s under memory pressure, turning 12-minute jobs into timeouts. It now defaults to off; callers can still pass `gc_between_testitems=true`, which helps suites whose items hold memory that only a finalizer releases. Updates the comments that stated the old default, adds a test item that pins the new default for a two-process run, and a changelog entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
execute_testrunno longer runs a fullGC.gc(true)after every test item by default. Passgc_between_testitems=trueto opt in. Until now it was on whenever a run used more than one test process, matching ReTestItems. It arrived in ff943d8, an unreviewed WIP commit.Why
Measured on JuliaWorkspaces.jl CI:
It can still help a suite whose items hold memory outside the Julia heap that only a finalizer releases, such as large C buffers, mmaps, handles or child processes. That's why it stays available as an option.
Changes
src/testitemcontroller.jl:something(gc_between_testitems, false), with a new explanatory comment.src/state.jl,TestItemServer.jlandtest/test_worker_lifecycle.jl: updated comments.@testitem"GC between test items is off by default, even for a multi-process run". It checks both the implicit default and an explicittrue, so it can't pass vacuously.Behaviour change for JSON-RPC callers (VS Code):
create_testrunnever passes this option, so those runs now always run without GC between items, and they have no way to turn it on.Testing
test/test_worker_lifecycle.jlpasses (60/60) on Julia 1.12.7.Related
🤖 Generated with Claude Code