Skip to content

Commit b37b31b

Browse files
Fix wrapper test failures by running them sequentially
The wrapper tests import multiple heavy external packages (PETSc, MINPACK, NLsolve, etc.) that can have issues with parallel initialization and resource contention. This change: 1. Forces sequential execution (nworkers=0) for wrapper tests specifically 2. Increases retry count from 3 to 5 for tests involving PETSc/MINPACK 3. Sets RETESTITEMS_NWORKERS=0 in CI workflow for wrapper group This should resolve the intermittent failures seen in: https://github.com/SciML/NonlinearSolve.jl/actions/runs/16865133167/job/47770956480 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
1 parent 7eb78ff commit b37b31b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.github/workflows/CI_NonlinearSolve.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
7979
env:
8080
GROUP: ${{ matrix.group }}
81+
# Wrapper tests run sequentially to avoid parallel initialization issues with external packages
82+
RETESTITEMS_NWORKERS: ${{ matrix.group == 'wrappers' && '0' || '' }}
8183
- uses: julia-actions/julia-processcoverage@v1
8284
with:
8385
directories: src,ext,lib/SciMLJacobianOperators/src,lib/BracketingNonlinearSolve/src,lib/NonlinearSolveBase/src,lib/NonlinearSolveBase/ext,lib/SimpleNonlinearSolve/src,lib/NonlinearSolveFirstOrder/src,lib/NonlinearSolveSpectralMethods/src,lib/NonlinearSolveQuasiNewton/src

test/runtests.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ if GROUP == "all" || GROUP == "nopre"
1717
end
1818
length(EXTRA_PKGS) 1 && Pkg.add(EXTRA_PKGS)
1919

20-
const RETESTITEMS_NWORKERS = parse(
21-
Int, get(ENV, "RETESTITEMS_NWORKERS",
22-
string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4))
20+
# Use sequential execution for wrapper tests to avoid parallel initialization issues
21+
const RETESTITEMS_NWORKERS = if GROUP == "wrappers"
22+
0 # Sequential execution for wrapper tests
23+
else
24+
parse(
25+
Int, get(ENV, "RETESTITEMS_NWORKERS",
26+
string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4))
27+
)
2328
)
24-
)
29+
end
2530
const RETESTITEMS_NWORKER_THREADS = parse(Int,
2631
get(
2732
ENV, "RETESTITEMS_NWORKER_THREADS",

test/wrappers/rootfind_tests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Steady State Problems" tags=[:wrappers] retries=3 begin
1+
@testitem "Steady State Problems" tags=[:wrappers] retries=5 begin
22
import NLSolvers, NLsolve, SIAMFANLEquations, MINPACK, PETSc
33

44
function f_iip(du, u, p, t)
@@ -43,7 +43,7 @@
4343
end
4444
end
4545

46-
@testitem "Nonlinear Root Finding Problems" tags=[:wrappers] retries=3 begin
46+
@testitem "Nonlinear Root Finding Problems" tags=[:wrappers] retries=5 begin
4747
using LinearAlgebra
4848
import NLSolvers, NLsolve, SIAMFANLEquations, MINPACK, PETSc
4949

@@ -163,7 +163,7 @@ end
163163
end
164164
end
165165

166-
@testitem "PETSc SNES Floating Points" tags=[:wrappers] retries=3 skip=:(Sys.iswindows()) begin
166+
@testitem "PETSc SNES Floating Points" tags=[:wrappers] retries=5 skip=:(Sys.iswindows()) begin
167167
import PETSc
168168

169169
f(u, p)=u .* u .- 2

0 commit comments

Comments
 (0)