Skip to content

test: warn when the host is oversubscribed during the test suite, move JuliaLowering_stdlibs to node1#62392

Open
IanButterworth wants to merge 6 commits into
JuliaLang:masterfrom
IanButterworth:ib/test-oversubscription-warning
Open

test: warn when the host is oversubscribed during the test suite, move JuliaLowering_stdlibs to node1#62392
IanButterworth wants to merge 6 commits into
JuliaLang:masterfrom
IanButterworth:ib/test-oversubscription-warning

Conversation

@IanButterworth

@IanButterworth IanButterworth commented Jul 15, 2026

Copy link
Copy Markdown
Member
  • Add an oversubscription warning
  • Move JuliaLowering_stdlibs to node1 because it was building a sysimage and precompiling stdlibs in parallel to a full breadth of test workers. Massively oversubscribing at times.

Before JuliaLowering_stdlibs was moved to node1: https://buildkite.com/julialang/julia-pr/builds/457#019f666e-515e-4c46-9370-307e25f5627a

Screenshot 2026-07-16 at 10 04 42 AM

@IanButterworth IanButterworth changed the title test: warn when the host is oversubscribed during the test suite test: warn when the host is oversubscribed during the test suite, move JuliaLowering_stdlibs to node1 Jul 15, 2026
@IanButterworth IanButterworth marked this pull request as ready for review July 15, 2026 17:14
@IanButterworth IanButterworth added test This change adds or pertains to unit tests ci Continuous integration labels Jul 15, 2026
@IanButterworth IanButterworth force-pushed the ib/test-oversubscription-warning branch from a245f96 to c0aa2f8 Compare July 16, 2026 13:31
IanButterworth and others added 2 commits July 16, 2026 11:29
Add a periodic monitor to Base.runtests that prints a warning, alongside
the currently-running tests, when the machine's load average exceeds its
CPU count. Load average is a whole-machine metric, so this surfaces both
tests/subprocesses spawning more threads than cores and contention from
other jobs sharing the host. The interval and the load-to-CPU factor are
configurable via JULIA_TEST_OVERSUBSCRIPTION_INTERVAL and
JULIA_TEST_OVERSUBSCRIPTION_FACTOR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@IanButterworth IanButterworth force-pushed the ib/test-oversubscription-warning branch from c0aa2f8 to 3fcafff Compare July 16, 2026 15:29
Extend the oversubscription warning to annotate each running test with its
current CPU usage. Usage is derived by differencing two `ps` snapshots of
cumulative CPU time and summing over each test worker's whole process subtree,
so CPU spent in subprocesses a test spawns counts toward it, which is where
most over-100% usage comes from. CPU time is used rather than the `ps` %CPU
column because the latter is unreliable on some platforms (FreeBSD reports ~0).
The figure is omitted on Windows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@IanButterworth IanButterworth force-pushed the ib/test-oversubscription-warning branch from 3fcafff to 8cecdc6 Compare July 16, 2026 16:34
IanButterworth and others added 3 commits July 16, 2026 13:53
The per-test CPU figure in the oversubscription warning was read from the `ps`
`%cpu` column, which is a platform-dependent decaying average: on FreeBSD it
reports ~0, so every test showed 0%, and on macOS the column produced no usable
figure at all. Sample cumulative CPU time from `ps` instead and difference two
snapshots over the reporting interval, summed across each worker's process
subtree. This is portable across macOS, Linux and the BSDs.

CI showing 0% on FreeBSD:
https://buildkite.com/julialang/julia-pr/builds/494

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
FreeBSD's `ps` still showed 0% for every test because `ps -o pid=,ppid=,time=`
is parsed differently there: the text after the first `=` is taken as a header,
collapsing the output to a single column, so no CPU-time rows were parsed and
every delta was zero. macOS and Linux split on the commas first, which is why
only FreeBSD was affected. Use separate `-o pid= -o ppid= -o time=` flags, which
suppress each header unambiguously on all `ps` variants.

CI showing 0% on FreeBSD:
https://buildkite.com/julialang/julia-pr/builds/496

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Express the load average and CPU capacity as percentages (100% == one core), the
same unit as the per-test figures, and add the summed usage the test workers own,
so it can be compared directly against total system load to see how much of the
overload is the test suite's versus other processes on the host.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration test This change adds or pertains to unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant