From d1969e9c733590140638c7bc957947b57b333286 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sun, 20 Sep 2026 23:11:38 -0300 Subject: [PATCH 1/3] Move INIT constants closer to where they're used --- src/ParallelTestRunner.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 7933d3d..1a5f77e 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -107,12 +107,6 @@ function init_time(rec::AbstractTestRecord) return base.total_time - base.time end -# the user is warned once a warm worker's init time exceeds this multiple of the cold-start cost... -const SLOW_INIT_FACTOR = 2 -# ... but only if it also exceeds this many seconds, to avoid false positives in test suites -# with a short cold worker init -const SLOW_INIT_MIN_TIME = 10.0 - function Base.getindex(rec::AbstractTestRecord) return parent(rec).value end @@ -933,6 +927,12 @@ function runtests(mod::Module, args::ParsedArgs; ) end +# the user is warned once a warm worker's init time exceeds this multiple of the cold-start cost... +const SLOW_INIT_FACTOR = 2 +# ... but only if it also exceeds this many seconds, to avoid false positives in test suites +# with a short cold worker init +const SLOW_INIT_MIN_TIME = 10.0 + # Helper function, to be used for testing, with `tests` already sorted. function _runtests(mod::Module, args::ParsedArgs; testsuite::Dict{String,Expr} = find_tests(pwd()), From e73c2b2473d347c7351c2806aaeaa4f26daca6e2 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sun, 20 Sep 2026 23:17:46 -0300 Subject: [PATCH 2/3] Fix typo --- src/ParallelTestRunner.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 1a5f77e..e3ab919 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -353,7 +353,7 @@ function execute(::Type{TestRecord}, mod::Module, f, name, start_time, _custom_a GC.gc(true) Random.seed!(1) - # @testset CustomTestRecord switches the all lower-level testset to our custom testset, + # @testset CustomTestSet switches the all lower-level testset to our custom testset, # so we need to have two layers here such that the user-defined testsets are using `DefaultTestSet`. # This also guarantees our invariant about `WorkerTestSet` containing a single `DefaultTestSet`. stats = @timed @testset WorkerTestSet "placeholder" begin From 3d3948f42e406a3036ef9ae5d1bf5874a8c19d82 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sun, 20 Sep 2026 23:33:53 -0300 Subject: [PATCH 3/3] Move history include up --- src/ParallelTestRunner.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index e3ab919..0a97461 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -23,6 +23,9 @@ include("compatutils.jl") # PTRWorker, worker_id, test_exe, addworkers, addworker include("ptrworker.jl") +include("history.jl") +using .TestHistory + # Always set the max rss so that if tests add large global variables # (which they do) we don't make the GC's life too hard. Apple's memory # management makes setting this value more complicated than it should @@ -427,9 +430,6 @@ function default_njobs(; return max(1, min(_cpu_threads, memory_jobs)) end -include("history.jl") -using .TestHistory - """ find_tests(dir::String) -> Dict{String, Expr}