From 826448959e7aa71014f6268e41fa664a7777f84c Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 1 Nov 2024 14:49:09 -0400 Subject: [PATCH 1/4] ci: run windows tests with a single worker --- lib/NonlinearSolveFirstOrder/test/runtests.jl | 4 +++- lib/NonlinearSolveQuasiNewton/test/runtests.jl | 4 +++- lib/NonlinearSolveSpectralMethods/test/runtests.jl | 4 +++- test/runtests.jl | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/NonlinearSolveFirstOrder/test/runtests.jl b/lib/NonlinearSolveFirstOrder/test/runtests.jl index d19d33de8..ff3138344 100644 --- a/lib/NonlinearSolveFirstOrder/test/runtests.jl +++ b/lib/NonlinearSolveFirstOrder/test/runtests.jl @@ -5,7 +5,9 @@ using ReTestItems, NonlinearSolveFirstOrder, Hwloc, InteractiveUtils, Pkg const GROUP = lowercase(get(ENV, "GROUP", "All")) const RETESTITEMS_NWORKERS = parse( - Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4))) + Int, get(ENV, "RETESTITEMS_NWORKERS", + string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4)) + ) ) const RETESTITEMS_NWORKER_THREADS = parse(Int, get( diff --git a/lib/NonlinearSolveQuasiNewton/test/runtests.jl b/lib/NonlinearSolveQuasiNewton/test/runtests.jl index 807441bbc..fd5e95f9f 100644 --- a/lib/NonlinearSolveQuasiNewton/test/runtests.jl +++ b/lib/NonlinearSolveQuasiNewton/test/runtests.jl @@ -5,7 +5,9 @@ using ReTestItems, NonlinearSolveQuasiNewton, Hwloc, InteractiveUtils, Pkg const GROUP = lowercase(get(ENV, "GROUP", "All")) const RETESTITEMS_NWORKERS = parse( - Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4))) + Int, get(ENV, "RETESTITEMS_NWORKERS", + string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4)) + ) ) const RETESTITEMS_NWORKER_THREADS = parse(Int, get( diff --git a/lib/NonlinearSolveSpectralMethods/test/runtests.jl b/lib/NonlinearSolveSpectralMethods/test/runtests.jl index 5256e0e6f..4415c0a53 100644 --- a/lib/NonlinearSolveSpectralMethods/test/runtests.jl +++ b/lib/NonlinearSolveSpectralMethods/test/runtests.jl @@ -5,7 +5,9 @@ using ReTestItems, NonlinearSolveSpectralMethods, Hwloc, InteractiveUtils, Pkg const GROUP = lowercase(get(ENV, "GROUP", "All")) const RETESTITEMS_NWORKERS = parse( - Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4))) + Int, get(ENV, "RETESTITEMS_NWORKERS", + string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4)) + ) ) const RETESTITEMS_NWORKER_THREADS = parse(Int, get( diff --git a/test/runtests.jl b/test/runtests.jl index 59a43c2f9..f92a0725c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -10,7 +10,9 @@ const EXTRA_PKGS = Pkg.PackageSpec[] length(EXTRA_PKGS) ≥ 1 && Pkg.add(EXTRA_PKGS) const RETESTITEMS_NWORKERS = parse( - Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4))) + Int, get(ENV, "RETESTITEMS_NWORKERS", + string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4)) + ) ) const RETESTITEMS_NWORKER_THREADS = parse(Int, get( From 43c56cc5a132a89432e30ee07e90b23a49a0a49b Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 1 Nov 2024 14:50:58 -0400 Subject: [PATCH 2/4] test: try fixing more mac tests --- test/23_test_problems_tests.jl | 13 +++++++++++-- test/wrappers/least_squares_tests.jl | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/test/23_test_problems_tests.jl b/test/23_test_problems_tests.jl index 8fa4c47b6..35e17e52b 100644 --- a/test/23_test_problems_tests.jl +++ b/test/23_test_problems_tests.jl @@ -120,7 +120,11 @@ end broken_tests = Dict(alg => Int[] for alg in alg_ops) broken_tests[alg_ops[1]] = [1, 2, 3, 5, 21] if Sys.isapple() - broken_tests[alg_ops[2]] = [1, 2, 3, 5, 6, 21] + if VERSION ≥ v"1.11-" + broken_tests[alg_ops[2]] = [1, 2, 3, 5, 6, 11, 21] + else + broken_tests[alg_ops[2]] = [1, 2, 3, 5, 6, 21] + end else broken_tests[alg_ops[2]] = [1, 2, 3, 5, 6, 11, 21] end @@ -143,11 +147,16 @@ end if Sys.isapple() broken_tests[alg_ops[1]] = [1, 5, 11] broken_tests[alg_ops[3]] = [1, 5, 6, 9, 11] + if VERSION ≥ v"1.11-" + broken_tests[alg_ops[5]] = [1, 4, 5, 11] + else + broken_tests[alg_ops[5]] = [1, 5, 11] + end else broken_tests[alg_ops[1]] = [1, 5, 11, 15] broken_tests[alg_ops[3]] = [1, 5, 9, 11, 16] + broken_tests[alg_ops[5]] = [1, 5, 11] end - broken_tests[alg_ops[5]] = [1, 5, 11] test_on_library(problems, dicts, alg_ops, broken_tests, Sys.isapple() ? 1e-3 : 1e-4) end diff --git a/test/wrappers/least_squares_tests.jl b/test/wrappers/least_squares_tests.jl index 99d3e0ef3..effef126e 100644 --- a/test/wrappers/least_squares_tests.jl +++ b/test/wrappers/least_squares_tests.jl @@ -83,7 +83,7 @@ end push!(solvers, FastLevenbergMarquardtJL(linsolve; autodiff)) end - if Sys.isapple() + if !Sys.isapple() for method in (:auto, :lm, :lmdif) push!(solvers, CMINPACK(; method)) end From 271d64cd72bf6e2abc4a9e7916e954d34f43b1d7 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 1 Nov 2024 15:53:00 -0400 Subject: [PATCH 3/4] test: div by zero --- lib/NonlinearSolveFirstOrder/test/runtests.jl | 2 +- lib/NonlinearSolveQuasiNewton/test/runtests.jl | 2 +- lib/NonlinearSolveSpectralMethods/test/runtests.jl | 2 +- test/runtests.jl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/NonlinearSolveFirstOrder/test/runtests.jl b/lib/NonlinearSolveFirstOrder/test/runtests.jl index ff3138344..504529eab 100644 --- a/lib/NonlinearSolveFirstOrder/test/runtests.jl +++ b/lib/NonlinearSolveFirstOrder/test/runtests.jl @@ -12,7 +12,7 @@ const RETESTITEMS_NWORKERS = parse( const RETESTITEMS_NWORKER_THREADS = parse(Int, get( ENV, "RETESTITEMS_NWORKER_THREADS", - string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1)) + string(max(Hwloc.num_virtual_cores() ÷ max(RETESTITEMS_NWORKERS, 1), 1)) ) ) diff --git a/lib/NonlinearSolveQuasiNewton/test/runtests.jl b/lib/NonlinearSolveQuasiNewton/test/runtests.jl index fd5e95f9f..0f8eaba49 100644 --- a/lib/NonlinearSolveQuasiNewton/test/runtests.jl +++ b/lib/NonlinearSolveQuasiNewton/test/runtests.jl @@ -12,7 +12,7 @@ const RETESTITEMS_NWORKERS = parse( const RETESTITEMS_NWORKER_THREADS = parse(Int, get( ENV, "RETESTITEMS_NWORKER_THREADS", - string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1)) + string(max(Hwloc.num_virtual_cores() ÷ max(RETESTITEMS_NWORKERS, 1), 1)) ) ) diff --git a/lib/NonlinearSolveSpectralMethods/test/runtests.jl b/lib/NonlinearSolveSpectralMethods/test/runtests.jl index 4415c0a53..e254158b3 100644 --- a/lib/NonlinearSolveSpectralMethods/test/runtests.jl +++ b/lib/NonlinearSolveSpectralMethods/test/runtests.jl @@ -12,7 +12,7 @@ const RETESTITEMS_NWORKERS = parse( const RETESTITEMS_NWORKER_THREADS = parse(Int, get( ENV, "RETESTITEMS_NWORKER_THREADS", - string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1)) + string(max(Hwloc.num_virtual_cores() ÷ max(RETESTITEMS_NWORKERS, 1), 1)) ) ) diff --git a/test/runtests.jl b/test/runtests.jl index f92a0725c..c8e8b0f4e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,7 +17,7 @@ const RETESTITEMS_NWORKERS = parse( const RETESTITEMS_NWORKER_THREADS = parse(Int, get( ENV, "RETESTITEMS_NWORKER_THREADS", - string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1)) + string(max(Hwloc.num_virtual_cores() ÷ max(RETESTITEMS_NWORKERS, 1), 1)) ) ) From f93b67aca3ba94262747d93fcc7d1db709f26f98 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Fri, 1 Nov 2024 15:54:01 -0400 Subject: [PATCH 4/4] test: add retries to guard against segfaults --- test/wrappers/rootfind_tests.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/wrappers/rootfind_tests.jl b/test/wrappers/rootfind_tests.jl index 073d31fe4..654194e26 100644 --- a/test/wrappers/rootfind_tests.jl +++ b/test/wrappers/rootfind_tests.jl @@ -1,4 +1,4 @@ -@testitem "Steady State Problems" tags=[:wrappers] begin +@testitem "Steady State Problems" tags=[:wrappers] retries=3 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] begin +@testitem "Nonlinear Root Finding Problems" tags=[:wrappers] retries=3 begin using LinearAlgebra import NLSolvers, NLsolve, SIAMFANLEquations, MINPACK, PETSc @@ -163,7 +163,7 @@ end end end -@testitem "PETSc SNES Floating Points" tags=[:wrappers] skip=:(Sys.iswindows()) begin +@testitem "PETSc SNES Floating Points" tags=[:wrappers] retries=3 skip=:(Sys.iswindows()) begin import PETSc f(u, p) = u .* u .- 2