Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/ParallelTestRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}

Expand Down Expand Up @@ -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()),
Expand Down
Loading