Repository navigation
Run tests with ParallelTestRunner - #323
Merged
Merged
Conversation
Each test file now runs in its own sandbox module on a pool of worker processes, so the per-file `module` wrappers are dropped. The #218 multithreaded recording test moves to `test/ThreadsTests.jl` and gets a dedicated 4-thread worker via `test_worker`; all other workers stay single-threaded, so `JULIA_NUM_THREADS` is no longer set in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devmotion
force-pushed
the
dmw/parallel-test-runner
branch
from
October 22, 2026 18:39
bef8cbd to
3e832c1
Compare
ParallelTestRunner loads Statistics on its workers, so StatisticsExt is always loaded before LinAlgTests runs. Drop the check that it isn't, and the DOWNGRADE_TEST variable that only existed for it. Require ParallelTestRunner 2.0.1, which fixes the paths of nested tests returned by find_tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #323 +/- ##
=======================================
Coverage 94.27% 94.27%
=======================================
Files 19 19
Lines 1695 1695
=======================================
Hits 1598 1598
Misses 97 97 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ElementwiseTests and JacobianTests dominated the wall time of the parallel test run. Move the binary DiffRules tests into ElementwiseBinaryTests and the nested Jacobian tests into NestedJacobianTests, with the shared elementwise helpers in derivatives/elementwise_utils.jl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ings ElementwiseBinaryTests took about 960 s on its own worker and set the wall time of the whole run, while the other workers finished after about 750 s. Each half now takes every other binary rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devmotion
commented
Oct 23, 2026
devmotion
commented
Oct 23, 2026
Co-authored-by: David Müller-Widmann <devmotion@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests have become a bit slow, so this switches
test/runtests.jlto ParallelTestRunner.jl, as ChainRules did in JuliaDiff/ChainRules.jl#848. The test files used to run one after another in one process. Now each runs on its own worker process, in parallel.find_testspicks up every file undertest/except the helpersutils.jlandderivatives/elementwise_utils.jl. ParallelTestRunner evaluates each file in its own module, so the per-filemodule ... endwrappers are removed. The nestedIsolatedModuleForTestingScopinginChainRulesTests.jlis kept. Without the wrapper, four loop variables inTrackedTests.jltriggered soft-scope warnings, so they are now declaredlocal.api/JacobianTests.jltoapi/NestedJacobianTests.jl. The binary rule tests move fromderivatives/ElementwiseTests.jltoderivatives/ElementwiseBinaryTests1.jlandElementwiseBinaryTests2.jl, which each take every other rule. The shared helpers move toderivatives/elementwise_utils.jl.api/GradientTests.jltotest/ThreadsTests.jl, unchanged. ParallelTestRunner's workers are single-threaded, sotest_workergives only this file a dedicated worker with--threads=4. A new@test Threads.nthreads() > 1makes the test fail if it ever runs on a single-threaded worker, instead of passing without testing anything concurrent.JULIA_NUM_THREADS: 4is removed from CI, since only that test needed it. A side effect is that a localPkg.testnow runs it multithreaded too.ParallelTestRunner = "2.0.1"is added totest/Project.toml. v2.0.0 has a bug wherefind_testsdoubles the directory of nested tests, e.g.compat/compat/CompatTests.jl.StatisticsExtis already loaded whenderivatives/LinAlgTestsstarts. The check that it is not loaded beforeusing Statisticsis removed, along with theDOWNGRADE_TESTvariable in the Downgrade workflow, which existed only to skip that check.You can now select tests, e.g.
Pkg.test("ReverseDiff"; test_args=["api/GradientTests"]), or list them withtest_args=["--list"].🤖 Generated with Claude Code