From 91d4e4161b3c2af2aca039d849163b28a1ef7b9d Mon Sep 17 00:00:00 2001 From: Michel Schanen Date: Wed, 5 Aug 2026 10:55:48 -0500 Subject: [PATCH] Detect ParallelTestRunner's failure-handling options instead of versioning them The `recycle_on_failure` and `retries` options were gated on `pkgversion(ParallelTestRunner) >= v"2.7.0"`, betting that ParallelTestRunner#148 would land in that release. It did not -- that PR is still open -- so once 2.7.0 hit the registry the guard started passing keyword arguments the released `runtests` does not accept, and every CI job failed with a MethodError before running a single test. Detect the keywords via `Base.kwarg_decl` instead. That is correct against both the registered releases and a development checkout carrying the PR, and it does not need updating when the options eventually ship. --- test/runtests.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 911b976d..d8914d1e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -183,7 +183,10 @@ end # On memory-pressured GPUs (e.g. 8GB cards) a failing test can leave the worker — or even # the driver — in a state where every subsequent allocation fails, so recycle workers on # failure and give failed files one exclusive retry on an otherwise-idle device. -failure_handling = if pkgversion(ParallelTestRunner) >= v"2.7.0" +# These options are not available in every ParallelTestRunner release, so detect them +# rather than gating on a version number. +runtests_kwargs = Set(Iterators.flatten(Base.kwarg_decl.(methods(ParallelTestRunner.runtests)))) +failure_handling = if :recycle_on_failure in runtests_kwargs (; recycle_on_failure = true, retries = 1) else (;)