Skip to content

Commit 83446ee

Browse files
committed
Print available memory before tests as part of debug stats
1 parent 3991f99 commit 83446ee

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/ParallelTestRunner.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ function runtests(mod::Module, args::ParsedArgs;
832832
jobs = something(args.jobs, default_njobs())
833833
jobs = clamp(jobs, 1, length(tests))
834834
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.")
835+
!isnothing(args.debug_stats) && println(stdout, "Available memory: $(Base.format_bytes(available_memory()))")
835836
workers = fill(nothing, jobs)
836837

837838
t0 = time()

test/runtests.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ end
3030
runtests(ParallelTestRunner, ["--debug-stats"]; stdout=io_color, stderr=io_color)
3131
str = String(take!(io))
3232

33-
@test contains(str, "time (s)") # timing
33+
@test contains(str, "time (s)")
3434

35-
@test contains(str, "Init") # debug timing
36-
if VERSION >= v"1.11" # compile time as part of the struct not available before 1.11
37-
@test contains(str, "Compile") # debug timing
38-
@test contains(str, "(%)") # debug timing
35+
@test contains(str, "Available memory:")
36+
@test contains(str, "Init")
37+
38+
# compile time as part of the struct not available before 1.11
39+
if VERSION >= v"1.11"
40+
@test contains(str, "Compile")
41+
@test contains(str, "(%)")
3942
end
4043
end
4144

0 commit comments

Comments
 (0)