From 698e93e5e04182a8f7e240cb6a2a366094b75a64 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Sun, 10 Aug 2025 22:52:28 -0400 Subject: [PATCH] Fix wrapper test failures by running them sequentially MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/CI_NonlinearSolve.yml | 2 ++ test/runtests.jl | 13 +++++++++---- test/wrappers/rootfind_tests.jl | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI_NonlinearSolve.yml b/.github/workflows/CI_NonlinearSolve.yml index e045e1e37..e01ea6e75 100644 --- a/.github/workflows/CI_NonlinearSolve.yml +++ b/.github/workflows/CI_NonlinearSolve.yml @@ -78,6 +78,8 @@ jobs: shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0} env: GROUP: ${{ matrix.group }} + # Wrapper tests run sequentially to avoid parallel initialization issues with external packages + RETESTITEMS_NWORKERS: ${{ matrix.group == 'wrappers' && '0' || '' }} - uses: julia-actions/julia-processcoverage@v1 with: 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 diff --git a/test/runtests.jl b/test/runtests.jl index 16f697d67..a9c5183ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,11 +17,16 @@ if GROUP == "all" || GROUP == "nopre" end length(EXTRA_PKGS) ≥ 1 && Pkg.add(EXTRA_PKGS) -const RETESTITEMS_NWORKERS = parse( - Int, get(ENV, "RETESTITEMS_NWORKERS", - string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4)) +# Use sequential execution for wrapper tests to avoid parallel initialization issues +const RETESTITEMS_NWORKERS = if GROUP == "wrappers" + 0 # Sequential execution for wrapper tests +else + parse( + Int, get(ENV, "RETESTITEMS_NWORKERS", + string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4)) + ) ) -) +end const RETESTITEMS_NWORKER_THREADS = parse(Int, get( ENV, "RETESTITEMS_NWORKER_THREADS", diff --git a/test/wrappers/rootfind_tests.jl b/test/wrappers/rootfind_tests.jl index 3ecedc0f0..3046a1952 100644 --- a/test/wrappers/rootfind_tests.jl +++ b/test/wrappers/rootfind_tests.jl @@ -1,4 +1,4 @@ -@testitem "Steady State Problems" tags=[:wrappers] retries=3 begin +@testitem "Steady State Problems" tags=[:wrappers] retries=5 begin import NLSolvers, NLsolve, SIAMFANLEquations, MINPACK, PETSc function f_iip(du, u, p, t) @@ -43,7 +43,7 @@ end end -@testitem "Nonlinear Root Finding Problems" tags=[:wrappers] retries=3 begin +@testitem "Nonlinear Root Finding Problems" tags=[:wrappers] retries=5 begin using LinearAlgebra import NLSolvers, NLsolve, SIAMFANLEquations, MINPACK, PETSc @@ -163,7 +163,7 @@ end end end -@testitem "PETSc SNES Floating Points" tags=[:wrappers] retries=3 skip=:(Sys.iswindows()) begin +@testitem "PETSc SNES Floating Points" tags=[:wrappers] retries=5 skip=:(Sys.iswindows()) begin import PETSc f(u, p)=u .* u .- 2