diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 7933d3d..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 @@ -107,12 +110,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 @@ -359,7 +356,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 @@ -433,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} @@ -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()),