Skip to content

Internal: parallel test workers, CI without workloads and rebuilds - #216

Open
StackEnjoyer wants to merge 4 commits into
masterfrom
internal/parallel-tests
Open

StackEnjoyer wants to merge 4 commits into
masterfrom
internal/parallel-tests

Conversation

@StackEnjoyer

@StackEnjoyer StackEnjoyer commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Doc changes

  • AGENTS.md and contribute page: parallel test runner, --jobs=N, rules for new test files, CI flags
  • Agent skill: no files updated

Internal changes

  • Test files run in parallel workers via ParallelTestRunner.jl, longest first, each with its duration
  • Rendering/TestRenderErrors runs in a fresh worker that never loaded Makie
  • CI: coverage and --check-bounds=yes on the Julia 1 job only, precompilation as a step of its own
  • CI: tests without the precompile workloads, which the Makie extension now also skips by preference
  • Locally with 4 workers: 4:54 instead of 9:00, 6:36 instead of 14:40 with the CI flags
  • Style: checked against AGENTS.md

Closes #215

test/runtests.jl uses ParallelTestRunner.jl: every test file under test/ is
found automatically and runs in a worker process, longest first, with its
duration printed. Rendering/TestRenderErrors runs in a fresh worker that
never loaded Makie. Locally with 4 workers: 4:54 instead of 9:00 without
flags, 6:36 instead of 14:40 with the CI coverage and bounds-check flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StackEnjoyer StackEnjoyer added this to the v0.14.0 milestone Nov 3, 2026
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.20%. Comparing base (051c316) to head (384f58e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
- Coverage   92.21%   92.20%   -0.02%     
==========================================
  Files          85       85              
  Lines        4421     4413       -8     
==========================================
- Hits         4077     4069       -8     
  Misses        344      344              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@StackEnjoyer StackEnjoyer changed the title Internal: test files run in parallel worker processes Internal: parallel test workers, CI without workloads and rebuilds Nov 3, 2026
The test job runs test/runtests.jl directly instead of julia-runtest: coverage
and --check-bounds=yes only on the Julia 1 job, since each set of flags needs
its own build of all dependencies (485 s on the 1.12 job of #216), and
precompilation as a step of its own. CI sets the preference
precompile_workload of BMO, which the workload of the Makie extension now
reads as well, since PrecompileTools does not find it for an extension. The
test step puts test/ on JULIA_LOAD_PATH, such that the preference also holds
in the environment in which Aqua precompiles the package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StackEnjoyer

Copy link
Copy Markdown
Owner Author

Agent review, round 1: approve · 0 blocker, 0 should, 1 nit, 2 note · merges cleanly, 15951/15951 tests pass locally (4 workers, 2m08)

Full review for agents (3 findings)

Scope

Verified

  • julia --project=test test/runtests.jl --jobs=4 on Julia 1.13.0, Windows 11: 15951/15951 pass in 2m08.5s. All 63 test files ran; Rendering/TestRenderErrors ran alone on worker 1 (a fresh worker), the other 62 on workers 2-5
  • CI at head: "Julia 1" (coverage, --check-bounds=yes, no workloads) and "Documentation" pass; "Julia 1.12" still running at review time; "Julia pre" fails (see F2)
  • Checked by reading ParallelTestRunner 2.10.0:
    • find_tests skips runtests.jl and replaces the path separator with /, so "Rendering/TestRenderErrors" in makie_free_tests also matches on Windows
    • custom workers from test_worker are stopped after their test
    • workers start from Base.julia_cmd(), which forwards --check-bounds=yes and --code-coverage=@<path> (Julia base/util.jl), so CI coverage and bounds checks reach the workers
    • default_njobs is max(1, min(cpu_threads, free_memory ÷ 2 GiB, max_default_jobs)), which matches the text in AGENTS.md
  • Checked by reading the code: Preferences is a direct dependency of BMO, so the Makie extension can load it; BeamletOptics is in test/Project.toml deps, so test/LocalPreferences.toml applies to it; the two @allocated tests (TestSDFBoundingSpheres, TestMesh) call the function once before they measure, so they do not depend on the precompile workloads; no test file includes another one or writes into a shared path
  • Not run: the CI configuration with precompile_workload = false locally (taken from the passing "Julia 1" job), Julia 1.12 locally (not installed), the docs build

Findings

F1 · nit · AGENTS.md:291: documented setup fails for existing checkouts

  • Finding: On a checkout whose untracked workspace Manifest.toml predates this PR, the documented julia --project=test -e 'using Pkg; Pkg.instantiate()' errors with "ParallelTestRunner is a direct dependency, but does not appear in the manifest".
  • Evidence: Ran it on this machine after checking out the branch; Pkg.resolve() followed by Pkg.instantiate() fixes it. Fresh clones and CI have no manifest and are not affected.
  • Expected: A developer who follows AGENTS.md or the contribute page on an existing checkout gets a working test environment, or is told to run Pkg.resolve() once when the test dependencies change.
  • Suggestion: Optional: one half-sentence in the "Tests" section of AGENTS.md and in contribute.md. This applies to every new test dependency, not only to this one.

F2 · note · .github/workflows/CI.yml:31: the "Julia pre" job fails

  • Finding: The pre job fails at head. It fails on master at 051c316 too, and continue-on-error keeps it from failing the CI, so this PR does not cause it.
  • Evidence: GitHub check runs of both commits. The job log needs admin rights, so the cause was not checked.
  • Expected: No change in this PR.

F3 · note · ext/BeamletOpticsMakieExt.jl:79: the extension's cache is not keyed on the preference of BMO on Julia 1.12

  • Finding: On 1.12 the pkgimage header records only the preferences of the module being compiled (__toplevel__ in src/staticdata_utils.c), so reading BMO's precompile_workload from the extension does not make the extension's cache depend on it. On 1.13 get_preferences_blob records the preferences of every UUID. This does not break anything: changing the preference rebuilds BMO, because PrecompileTools reads it for BMO's own UUID, and the new build ID of BMO makes the extension's cache stale as well. The comment in the code is accurate.
  • Evidence: Read base/loading.jl and src/staticdata_utils.c of Julia v1.12.1 and base/loading.jl of the installed 1.13.0.
  • Expected: No change. Noted in case someone later reads this preference in the extension without a matching read in BMO.

@StackEnjoyer

Copy link
Copy Markdown
Owner Author

Since I am messing around with the testsets you should have a look too @TacHawkes

uitt_hu and others added 2 commits November 3, 2026 20:23
The Julia 1 job compiled all dependencies again in every run (407 s in the
re-run of #216), since what was precompiled under --code-coverage did not
survive in its cache. The precompile step now runs with --check-bounds=yes
only, and the coverage flag goes to the test step alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An existing workspace Manifest.toml that predates a new test dependency makes
Pkg.instantiate fail (review of #216, F1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@TacHawkes TacHawkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not experienced with the parallel tests but seems like a good change. I also like that tests are auto-discovered now.

@StackEnjoyer StackEnjoyer removed this from the v0.14.0 milestone Nov 4, 2026
@StackEnjoyer

Copy link
Copy Markdown
Owner Author

Changes in runtime are not as amazing here as I hoped. This does not need to go in 0.14.0

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal: CI test jobs take 11–20 min

2 participants