Skip to content

Commit ec4275b

Browse files
committed
Print available memory before tests as part of debug stats
1 parent 3b5cd91 commit ec4275b

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
@@ -829,6 +829,7 @@ function runtests(mod::Module, args::ParsedArgs;
829829
jobs = something(args.jobs, default_njobs())
830830
jobs = clamp(jobs, 1, length(tests))
831831
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.")
832+
!isnothing(args.debug_stats) && println(stdout, "Available memory: $(Base.format_bytes(available_memory()))")
832833
workers = fill(nothing, jobs)
833834

834835
t0 = time()

test/runtests.jl

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

35-
@test contains(str, "time (s)") # timing
35+
@test contains(str, "time (s)")
3636

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

0 commit comments

Comments
 (0)