From a4cf186a16129b723d7fa8fe750e4f104587ad06 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Tue, 28 Jul 2026 16:10:10 -0300 Subject: [PATCH 1/2] Max RSS in red if worker is to be killed --- src/ParallelTestRunner.jl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index a6903e0..95d2eb0 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -166,9 +166,10 @@ struct TestIOContext percent_align::Int alloc_align::Int rss_align::Int + max_worker_rss::Int end -function test_IOContext(::Type{<:AbstractTestRecord}, stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int, verbose::Bool) +function test_IOContext(::Type{<:AbstractTestRecord}, stdout::IO, stderr::IO, lock::ReentrantLock, name_align::Int, verbose::Bool, max_worker_rss::Int) elapsed_align = textwidth("time (s)") compile_align = textwidth("Compile") gc_align = textwidth("GC (s)") @@ -180,7 +181,7 @@ function test_IOContext(::Type{<:AbstractTestRecord}, stdout::IO, stderr::IO, lo return TestIOContext( stdout, stderr, color, verbose, lock, name_align, elapsed_align, compile_align, gc_align, percent_align, - alloc_align, rss_align + alloc_align, rss_align, max_worker_rss ) end @@ -250,8 +251,12 @@ function print_test_finished(record::AbstractTestRecord, wrkr, test, ctx::TestIO alloc_str = @sprintf("%5.2f", base.bytes / 2^20) printstyled(ctx.stdout, lpad(alloc_str, ctx.alloc_align, " "), " │ ", color = :white) - rss_str = @sprintf("%5.2f", memory_usage(record) / 2^20) - printstyled(ctx.stdout, lpad(rss_str, ctx.rss_align, " "), " │\n", color = :white) + mem_use = memory_usage(record) + mem_color = mem_use > ctx.max_worker_rss ? :red : :white + rss_str = @sprintf("%5.2f", mem_use / 2^20) + printstyled(ctx.stdout, lpad(rss_str, ctx.rss_align, " "), color = mem_color) + + printstyled(ctx.stdout, " │\n", color = :white) flush(ctx.stdout) finally @@ -1037,7 +1042,7 @@ function _runtests(mod::Module, args::ParsedArgs; stderr.lock = print_lock end - io_ctx = test_IOContext(RecordType, stdout, stderr, print_lock, name_align, !isnothing(args.verbose)) + io_ctx = test_IOContext(RecordType, stdout, stderr, print_lock, name_align, !isnothing(args.verbose), max_worker_rss) print_header(RecordType, io_ctx, testgroupheader, workerheader) status_lines_visible = Ref(0) From 0a58e3045aa2ea7eccca6c4d6f975aa12ab9caf8 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Tue, 28 Jul 2026 20:33:07 -0300 Subject: [PATCH 2/2] Add mention of red RSS --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index 65349d6..41122a5 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -114,7 +114,7 @@ The test runner provides real-time output showing: - Execution time - GC time and percentage - Memory allocation -- RSS (Resident Set Size) memory usage +- RSS (Resident Set Size) memory usage, shown in red once it exceeds the RSS threshold and the worker will be restarted ### Graceful Interruption