From 31f028631687143e3c6dcd5ba1b99b2a88401a34 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sun, 25 Jan 2026 19:53:20 -0400 Subject: [PATCH 1/6] Display pre-test time --- src/ParallelTestRunner.jl | 46 +++++++++++++++++++++++++++++---------- test/runtests.jl | 11 ++++++++++ 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 2e1e633..a101458 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -87,6 +87,7 @@ struct TestRecord <: AbstractTestRecord bytes::UInt64 gctime::Float64 rss::UInt64 + total_time::Float64 end function memory_usage(rec::TestRecord) @@ -106,6 +107,7 @@ struct TestIOContext stdout::IO stderr::IO color::Bool + debug_timing::Bool lock::ReentrantLock name_align::Int elapsed_align::Int @@ -115,7 +117,7 @@ struct TestIOContext rss_align::Int end -function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int) +function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int, debug_timing::Bool) elapsed_align = textwidth("Time (s)") gc_align = textwidth("GC (s)") percent_align = textwidth("GC %") @@ -125,7 +127,7 @@ function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align: color = get(stdout, :color, false) return TestIOContext( - stdout, stderr, color, lock, name_align, elapsed_align, gc_align, percent_align, + stdout, stderr, color, debug_timing, lock, name_align, elapsed_align, gc_align, percent_align, alloc_align, rss_align ) end @@ -133,11 +135,18 @@ end function print_header(ctx::TestIOContext, testgroupheader, workerheader) lock(ctx.lock) try + # header top printstyled(ctx.stdout, " "^(ctx.name_align + textwidth(testgroupheader) - 3), " │ ") - printstyled(ctx.stdout, " │ ──────────────── CPU ──────────────── │\n", color = :white) + printstyled(ctx.stdout, " |", color = :white) + ctx.debug_timing && printstyled(ctx.stdout, " Init │", color = :white) + printstyled(ctx.stdout, " ──────────────── CPU ──────────────── │\n", color = :white) + + # header bottom printstyled(ctx.stdout, testgroupheader, color = :white) printstyled(ctx.stdout, lpad(workerheader, ctx.name_align - textwidth(testgroupheader) + 1), " │ ", color = :white) - printstyled(ctx.stdout, "Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │\n", color = :white) + printstyled(ctx.stdout, "Time (s) │", color = :white) + ctx.debug_timing && printstyled(ctx.stdout, " time (s) │", color = :white) + printstyled(ctx.stdout, " GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │\n", color = :white) flush(ctx.stdout) finally unlock(ctx.lock) @@ -163,9 +172,15 @@ function print_test_finished(record::TestRecord, wrkr, test, ctx::TestIOContext) try printstyled(ctx.stdout, test, color = :white) printstyled(ctx.stdout, lpad("($wrkr)", ctx.name_align - textwidth(test) + 1, " "), " │ ", color = :white) - time_str = @sprintf("%7.2f", record.time) + time = record.time + time_str = @sprintf("%7.2f", time) printstyled(ctx.stdout, lpad(time_str, ctx.elapsed_align, " "), " │ ", color = :white) + if ctx.debug_timing + init_time_str = @sprintf("%7.2f", record.total_time - time) + printstyled(ctx.stdout, lpad(init_time_str, ctx.elapsed_align, " "), " │ ", color = :white) + end + gc_str = @sprintf("%5.2f", record.gctime) printstyled(ctx.stdout, lpad(gc_str, ctx.gc_align, " "), " │ ", color = :white) percent_str = @sprintf("%4.1f", 100 * record.gctime / record.time) @@ -191,8 +206,11 @@ function print_test_failed(record::TestRecord, wrkr, test, ctx::TestIOContext) lpad("($wrkr)", ctx.name_align - textwidth(test) + 1, " "), " |" , color = :red ) - time_str = @sprintf("%7.2f", record.time) + time = record.time + time_str = @sprintf("%7.2f", time) printstyled(ctx.stderr, lpad(time_str, ctx.elapsed_align + 1, " "), " │", color = :red) + init_time_str = @sprintf("%7.2f", record.total_time - time) + printstyled(ctx.stdout, lpad(init_time_str, ctx.elapsed_align, " "), " │ ", color = :red) failed_str = "failed at $(now())\n" # 11 -> 3 from " | " 3x and 2 for each " " on either side @@ -278,7 +296,7 @@ function Test.finish(ts::WorkerTestSet) return ts.wrapped_ts end -function runtest(f, name, init_code) +function runtest(f, name, init_code, start_time) function inner() # generate a temporary module to execute the tests in mod = @eval(Main, module $(gensym(name)) end) @@ -307,7 +325,7 @@ function runtest(f, name, init_code) # process results rss = Sys.maxrss() - record = TestRecord(data..., rss) + record = TestRecord(data..., rss, time() - start_time) GC.gc(true) return record @@ -542,6 +560,7 @@ Fields are * `jobs::Union{Some{Int}, Nothing}`: the number of jobs * `verbose::Union{Some{Nothing}, Nothing}`: whether verbose printing was enabled +* `debug_timing::Union{Some{Nothing}, Nothing}`: whether debug timing printing was enabled * `quickfail::Union{Some{Nothing}, Nothing}`: whether quick fail was enabled * `list::Union{Some{Nothing}, Nothing}`: whether tests should be listed * `custom::Dict{String,Any}`: a dictionary of custom arguments @@ -550,6 +569,7 @@ Fields are struct ParsedArgs jobs::Union{Some{Int}, Nothing} verbose::Union{Some{Nothing}, Nothing} + debug_timing::Union{Some{Nothing}, Nothing} quickfail::Union{Some{Nothing}, Nothing} list::Union{Some{Nothing}, Nothing} @@ -607,7 +627,8 @@ function parse_args(args; custom::Array{String} = String[]) --list List all available tests. --verbose Print more information during testing. --quickfail Fail the entire run as soon as a single test errored. - --jobs=N Launch `N` processes to perform tests.""" + --jobs=N Launch `N` processes to perform tests. + --debug-timing Print testset initialization timings.""" if !isempty(custom) usage *= "\n\nCustom arguments:" @@ -622,6 +643,7 @@ function parse_args(args; custom::Array{String} = String[]) jobs = extract_flag!(args, "--jobs"; typ = Int) verbose = extract_flag!(args, "--verbose") + debug_timing = extract_flag!(args, "--debug-timing") quickfail = extract_flag!(args, "--quickfail") list = extract_flag!(args, "--list") @@ -636,7 +658,7 @@ function parse_args(args; custom::Array{String} = String[]) error("Unknown test options `$(join(optlike_args, " "))` (try `--help` for usage instructions)") end - return ParsedArgs(jobs, verbose, quickfail, list, custom_args, args) + return ParsedArgs(jobs, verbose, debug_timing, quickfail, list, custom_args, args) end """ @@ -836,7 +858,7 @@ function runtests(mod::Module, args::ParsedArgs; stderr.lock = print_lock end - io_ctx = test_IOContext(stdout, stderr, print_lock, name_align) + io_ctx = test_IOContext(stdout, stderr, print_lock, name_align, !isnothing(args.debug_timing)) print_header(io_ctx, testgroupheader, workerheader) status_lines_visible = Ref(0) @@ -1020,7 +1042,7 @@ function runtests(mod::Module, args::ParsedArgs; result = try Malt.remote_eval_wait(Main, wrkr.w, :(import ParallelTestRunner)) Malt.remote_call_fetch(invokelatest, wrkr.w, runtest, - testsuite[test], test, init_code) + testsuite[test], test, init_code, test_t0) catch ex if isa(ex, InterruptException) # the worker got interrupted, signal other tasks to stop diff --git a/test/runtests.jl b/test/runtests.jl index 4f09e17..564f3b3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -24,6 +24,17 @@ cd(@__DIR__) @test isfile(ParallelTestRunner.get_history_file(ParallelTestRunner)) end +@testset "debug timing" begin + io = IOBuffer() + io_color = IOContext(io, :color => true) + runtests(ParallelTestRunner, ["--debug-timing"]; stdout=io_color, stderr=io_color) + str = String(take!(io)) + + @test contains(str, "Init") # debug timing + @test contains(str, "time (s)") # debug timing + @test contains(str, "Time (s)") # normal timing +end + @testset "subdir use" begin d = @__DIR__ testsuite = find_tests(d) From 952fddbf81ee61f7e9d143ad8175fbceeb94e64e Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Tue, 10 Feb 2026 15:59:56 -0400 Subject: [PATCH 2/6] Add compilation % to debug timing display --- src/ParallelTestRunner.jl | 22 +++++++++++++++------- test/runtests.jl | 6 ++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index a101458..f404d1d 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -86,6 +86,7 @@ struct TestRecord <: AbstractTestRecord time::Float64 bytes::UInt64 gctime::Float64 + compile_time::Float64 rss::UInt64 total_time::Float64 end @@ -111,6 +112,7 @@ struct TestIOContext lock::ReentrantLock name_align::Int elapsed_align::Int + compile_align::Int gc_align::Int percent_align::Int alloc_align::Int @@ -118,7 +120,8 @@ struct TestIOContext end function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int, debug_timing::Bool) - elapsed_align = textwidth("Time (s)") + elapsed_align = textwidth("time (s)") + compile_align = textwidth("Compile") gc_align = textwidth("GC (s)") percent_align = textwidth("GC %") alloc_align = textwidth("Alloc (MB)") @@ -127,7 +130,7 @@ function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align: color = get(stdout, :color, false) return TestIOContext( - stdout, stderr, color, debug_timing, lock, name_align, elapsed_align, gc_align, percent_align, + stdout, stderr, color, debug_timing, lock, name_align, elapsed_align, compile_align, gc_align, percent_align, alloc_align, rss_align ) end @@ -137,15 +140,15 @@ function print_header(ctx::TestIOContext, testgroupheader, workerheader) try # header top printstyled(ctx.stdout, " "^(ctx.name_align + textwidth(testgroupheader) - 3), " │ ") - printstyled(ctx.stdout, " |", color = :white) - ctx.debug_timing && printstyled(ctx.stdout, " Init │", color = :white) + printstyled(ctx.stdout, " Test |", color = :white) + ctx.debug_timing && printstyled(ctx.stdout, " Init │ Compile │", color = :white) printstyled(ctx.stdout, " ──────────────── CPU ──────────────── │\n", color = :white) # header bottom printstyled(ctx.stdout, testgroupheader, color = :white) printstyled(ctx.stdout, lpad(workerheader, ctx.name_align - textwidth(testgroupheader) + 1), " │ ", color = :white) - printstyled(ctx.stdout, "Time (s) │", color = :white) - ctx.debug_timing && printstyled(ctx.stdout, " time (s) │", color = :white) + printstyled(ctx.stdout, "time (s) │", color = :white) + ctx.debug_timing && printstyled(ctx.stdout, " time (s) │ (%) │", color = :white) printstyled(ctx.stdout, " GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │\n", color = :white) flush(ctx.stdout) finally @@ -177,8 +180,13 @@ function print_test_finished(record::TestRecord, wrkr, test, ctx::TestIOContext) printstyled(ctx.stdout, lpad(time_str, ctx.elapsed_align, " "), " │ ", color = :white) if ctx.debug_timing + # pre-testset time init_time_str = @sprintf("%7.2f", record.total_time - time) printstyled(ctx.stdout, lpad(init_time_str, ctx.elapsed_align, " "), " │ ", color = :white) + + # compilation time + init_time_str = @sprintf("%7.2f", Float64(100*record.compile_time/time)) + printstyled(ctx.stdout, lpad(init_time_str, ctx.compile_align, " "), " │ ", color = :white) end gc_str = @sprintf("%5.2f", record.gctime) @@ -320,7 +328,7 @@ function runtest(f, name, init_code, start_time) $f end end - (; testset=stats.value, stats.time, stats.bytes, stats.gctime) + (; testset=stats.value, stats.time, stats.bytes, stats.gctime, stats.compile_time) end # process results diff --git a/test/runtests.jl b/test/runtests.jl index 564f3b3..09aaaad 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,9 +30,11 @@ end runtests(ParallelTestRunner, ["--debug-timing"]; stdout=io_color, stderr=io_color) str = String(take!(io)) + @test contains(str, "time (s)") # timing + @test contains(str, "Init") # debug timing - @test contains(str, "time (s)") # debug timing - @test contains(str, "Time (s)") # normal timing + @test contains(str, "Compile") # debug timing + @test contains(str, "(%)") # debug timing end @testset "subdir use" begin From 8328bda7cda872023c6a42a47919ce4c83483aa1 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Tue, 10 Feb 2026 21:15:52 -0400 Subject: [PATCH 3/6] Don't include compile time on 1.10 --- src/ParallelTestRunner.jl | 16 +++++++++++----- test/runtests.jl | 6 ++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index f404d1d..9044282 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -141,14 +141,16 @@ function print_header(ctx::TestIOContext, testgroupheader, workerheader) # header top printstyled(ctx.stdout, " "^(ctx.name_align + textwidth(testgroupheader) - 3), " │ ") printstyled(ctx.stdout, " Test |", color = :white) - ctx.debug_timing && printstyled(ctx.stdout, " Init │ Compile │", color = :white) + ctx.debug_timing && printstyled(ctx.stdout, " Init │", color = :white) + VERSION >= v"1.11" && ctx.debug_timing && printstyled(ctx.stdout, " Compile │", color = :white) printstyled(ctx.stdout, " ──────────────── CPU ──────────────── │\n", color = :white) # header bottom printstyled(ctx.stdout, testgroupheader, color = :white) printstyled(ctx.stdout, lpad(workerheader, ctx.name_align - textwidth(testgroupheader) + 1), " │ ", color = :white) printstyled(ctx.stdout, "time (s) │", color = :white) - ctx.debug_timing && printstyled(ctx.stdout, " time (s) │ (%) │", color = :white) + ctx.debug_timing && printstyled(ctx.stdout, " time (s) │", color = :white) + VERSION >= v"1.11" && ctx.debug_timing && printstyled(ctx.stdout, " (%) │", color = :white) printstyled(ctx.stdout, " GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │\n", color = :white) flush(ctx.stdout) finally @@ -185,8 +187,10 @@ function print_test_finished(record::TestRecord, wrkr, test, ctx::TestIOContext) printstyled(ctx.stdout, lpad(init_time_str, ctx.elapsed_align, " "), " │ ", color = :white) # compilation time - init_time_str = @sprintf("%7.2f", Float64(100*record.compile_time/time)) - printstyled(ctx.stdout, lpad(init_time_str, ctx.compile_align, " "), " │ ", color = :white) + if VERSION >= v"1.11" + init_time_str = @sprintf("%7.2f", Float64(100*record.compile_time/time)) + printstyled(ctx.stdout, lpad(init_time_str, ctx.compile_align, " "), " │ ", color = :white) + end end gc_str = @sprintf("%5.2f", record.gctime) @@ -328,7 +332,9 @@ function runtest(f, name, init_code, start_time) $f end end - (; testset=stats.value, stats.time, stats.bytes, stats.gctime, stats.compile_time) + + compile_time = @static VERSION >= v"1.11" ? stats.compile_time : 0.0 + (; testset=stats.value, stats.time, stats.bytes, stats.gctime, compile_time) end # process results diff --git a/test/runtests.jl b/test/runtests.jl index 09aaaad..9b747bd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -33,8 +33,10 @@ end @test contains(str, "time (s)") # timing @test contains(str, "Init") # debug timing - @test contains(str, "Compile") # debug timing - @test contains(str, "(%)") # debug timing + if VERSION >= v"1.11" # compile time as part of the struct not available before 1.11 + @test contains(str, "Compile") # debug timing + @test contains(str, "(%)") # debug timing + end end @testset "subdir use" begin From 2e712c8e9ebc15ed37526057db09cc0fef305b56 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:42:13 -0400 Subject: [PATCH 4/6] Rename to `debug-stats` --- src/ParallelTestRunner.jl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 9044282..ed9b5c6 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -108,7 +108,7 @@ struct TestIOContext stdout::IO stderr::IO color::Bool - debug_timing::Bool + debug_stats::Bool lock::ReentrantLock name_align::Int elapsed_align::Int @@ -119,7 +119,7 @@ struct TestIOContext rss_align::Int end -function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int, debug_timing::Bool) +function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int, debug_stats::Bool) elapsed_align = textwidth("time (s)") compile_align = textwidth("Compile") gc_align = textwidth("GC (s)") @@ -130,7 +130,7 @@ function test_IOContext(stdout::IO, stderr::IO, lock::ReentrantLock, name_align: color = get(stdout, :color, false) return TestIOContext( - stdout, stderr, color, debug_timing, lock, name_align, elapsed_align, compile_align, gc_align, percent_align, + stdout, stderr, color, debug_stats, lock, name_align, elapsed_align, compile_align, gc_align, percent_align, alloc_align, rss_align ) end @@ -141,16 +141,16 @@ function print_header(ctx::TestIOContext, testgroupheader, workerheader) # header top printstyled(ctx.stdout, " "^(ctx.name_align + textwidth(testgroupheader) - 3), " │ ") printstyled(ctx.stdout, " Test |", color = :white) - ctx.debug_timing && printstyled(ctx.stdout, " Init │", color = :white) - VERSION >= v"1.11" && ctx.debug_timing && printstyled(ctx.stdout, " Compile │", color = :white) + ctx.debug_stats && printstyled(ctx.stdout, " Init │", color = :white) + VERSION >= v"1.11" && ctx.debug_stats && printstyled(ctx.stdout, " Compile │", color = :white) printstyled(ctx.stdout, " ──────────────── CPU ──────────────── │\n", color = :white) # header bottom printstyled(ctx.stdout, testgroupheader, color = :white) printstyled(ctx.stdout, lpad(workerheader, ctx.name_align - textwidth(testgroupheader) + 1), " │ ", color = :white) printstyled(ctx.stdout, "time (s) │", color = :white) - ctx.debug_timing && printstyled(ctx.stdout, " time (s) │", color = :white) - VERSION >= v"1.11" && ctx.debug_timing && printstyled(ctx.stdout, " (%) │", color = :white) + ctx.debug_stats && printstyled(ctx.stdout, " time (s) │", color = :white) + VERSION >= v"1.11" && ctx.debug_stats && printstyled(ctx.stdout, " (%) │", color = :white) printstyled(ctx.stdout, " GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │\n", color = :white) flush(ctx.stdout) finally @@ -181,7 +181,7 @@ function print_test_finished(record::TestRecord, wrkr, test, ctx::TestIOContext) time_str = @sprintf("%7.2f", time) printstyled(ctx.stdout, lpad(time_str, ctx.elapsed_align, " "), " │ ", color = :white) - if ctx.debug_timing + if ctx.debug_stats # pre-testset time init_time_str = @sprintf("%7.2f", record.total_time - time) printstyled(ctx.stdout, lpad(init_time_str, ctx.elapsed_align, " "), " │ ", color = :white) @@ -574,7 +574,7 @@ Fields are * `jobs::Union{Some{Int}, Nothing}`: the number of jobs * `verbose::Union{Some{Nothing}, Nothing}`: whether verbose printing was enabled -* `debug_timing::Union{Some{Nothing}, Nothing}`: whether debug timing printing was enabled +* `debug_stats::Union{Some{Nothing}, Nothing}`: whether debug stats printing was enabled * `quickfail::Union{Some{Nothing}, Nothing}`: whether quick fail was enabled * `list::Union{Some{Nothing}, Nothing}`: whether tests should be listed * `custom::Dict{String,Any}`: a dictionary of custom arguments @@ -583,7 +583,7 @@ Fields are struct ParsedArgs jobs::Union{Some{Int}, Nothing} verbose::Union{Some{Nothing}, Nothing} - debug_timing::Union{Some{Nothing}, Nothing} + debug_stats::Union{Some{Nothing}, Nothing} quickfail::Union{Some{Nothing}, Nothing} list::Union{Some{Nothing}, Nothing} @@ -642,7 +642,7 @@ function parse_args(args; custom::Array{String} = String[]) --verbose Print more information during testing. --quickfail Fail the entire run as soon as a single test errored. --jobs=N Launch `N` processes to perform tests. - --debug-timing Print testset initialization timings.""" + --debug-stats Print information that could be helpful for debugging testset slowdowns.""" if !isempty(custom) usage *= "\n\nCustom arguments:" @@ -657,7 +657,7 @@ function parse_args(args; custom::Array{String} = String[]) jobs = extract_flag!(args, "--jobs"; typ = Int) verbose = extract_flag!(args, "--verbose") - debug_timing = extract_flag!(args, "--debug-timing") + debug_stats = extract_flag!(args, "--debug-timing") quickfail = extract_flag!(args, "--quickfail") list = extract_flag!(args, "--list") @@ -672,7 +672,7 @@ function parse_args(args; custom::Array{String} = String[]) error("Unknown test options `$(join(optlike_args, " "))` (try `--help` for usage instructions)") end - return ParsedArgs(jobs, verbose, debug_timing, quickfail, list, custom_args, args) + return ParsedArgs(jobs, verbose, debug_stats, quickfail, list, custom_args, args) end """ @@ -872,7 +872,7 @@ function runtests(mod::Module, args::ParsedArgs; stderr.lock = print_lock end - io_ctx = test_IOContext(stdout, stderr, print_lock, name_align, !isnothing(args.debug_timing)) + io_ctx = test_IOContext(stdout, stderr, print_lock, name_align, !isnothing(args.debug_stats)) print_header(io_ctx, testgroupheader, workerheader) status_lines_visible = Ref(0) From 5c11c34da541208a52c3509c8f80514be1412a25 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:50:41 -0400 Subject: [PATCH 5/6] [NFC] Remove pointless variable `jobs` is already clamped to be no higher than the number of tests so `min(job, length(tests))` is redundant --- src/ParallelTestRunner.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index ed9b5c6..225be8f 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -832,8 +832,7 @@ function runtests(mod::Module, args::ParsedArgs; jobs = something(args.jobs, default_njobs()) jobs = clamp(jobs, 1, length(tests)) println(stdout, "Running $jobs tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.") - nworkers = min(jobs, length(tests)) - workers = fill(nothing, nworkers) + workers = fill(nothing, jobs) t0 = time() results = [] From 275eefe5d14e3b77dd0c348be18472dbdee4f0cb Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:05:58 -0400 Subject: [PATCH 6/6] Print available memory before tests as part of debug stats --- src/ParallelTestRunner.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 225be8f..8cb3c14 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -832,6 +832,7 @@ function runtests(mod::Module, args::ParsedArgs; jobs = something(args.jobs, default_njobs()) jobs = clamp(jobs, 1, length(tests)) println(stdout, "Running $jobs tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.") + !isnothing(args.debug_stats) && println(stdout, "Available memory: $(Base.format_bytes(available_memory()))") workers = fill(nothing, jobs) t0 = time()