Skip to content

Fix wrapper test failures by running them sequentially #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/CI_NonlinearSolve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions test/wrappers/rootfind_tests.jl
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading