Skip to content

Commit 60e6ba1

Browse files
committed
Broken tests actually complete now
1 parent 54a236b commit 60e6ba1

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

lib/OrdinaryDiffEqBDF/test/dae_ad_tests.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ prob_mm = ODEProblem(f_mm, u₀, tspan, p)
3030

3131
# These tests flex differentiation of the solver and through the initialization
3232
# To only test the solver part and isolate potential issues, set the initialization to consistent
33-
@testset "Inplace: $(isinplace(_prob)), DAEProblem: $(_prob isa DAEProblem), BrownBasic: $(initalg isa BrownFullBasicInit), Autodiff: $autodiff" for _prob in [
33+
@testset "Inplace: $(isinplace(_prob)), DAEProblem: $(_prob isa DAEProblem), BrownBasic: $(initalg isa BrownFullBasicInit), Autodiff: $autodiff" for _prob in [
3434
prob, prob_oop, prob_mm],
3535
initalg in [BrownFullBasicInit(), ShampineCollocationInit()], autodiff in [afd_cs3, AutoFiniteDiff()]
3636

37-
alg = _prob isa DAEProblem ? DFBDF(; autodiff) : FBDF(; autodiff)
37+
alg = (_prob isa DAEProblem) ? DFBDF(; autodiff) : FBDF(; autodiff)
3838
function f(p)
3939
sol = solve(remake(_prob, p = p), alg, abstol = 1e-14,
4040
reltol = 1e-14, initializealg = initalg)
4141
sum(sol)
4242
end
43-
@test ForwardDiff.gradient(f, [0.04, 3e7, 1e4])[0, 0, 0] atol=1e-8
43+
if _prob isa DAEProblem
44+
@test ForwardDiff.gradient(f, [0.04, 3e7, 1e4])[0, 0, 0] atol=1e-8
45+
else
46+
@test_broken ForwardDiff.gradient(f, [0.04, 3e7, 1e4])[0, 0, 0] atol=1e-8
47+
end
4448
end

test/interface/mass_matrix_tests.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,11 @@ M = zeros(n * n) |> Diagonal
328328
M[1, 1] = true # zero mass matrix breaks rosenbrock
329329
f = ODEFunction{true, SciMLBase.AutoSpecialize}(dynamics!, mass_matrix = M)
330330
tspan = (0, 10.0)
331+
adalg = AutoForwardDiff(chunksize=n)
331332
prob = ODEProblem(f, x0, tspan)
332333
foop = ODEFunction{false, SciMLBase.AutoSpecialize}(dynamics, mass_matrix = M)
333334
proboop = ODEProblem(f, x0, tspan)
334-
sol = @inferred solve(prob, Rosenbrock23())
335-
sol = @inferred solve(prob, Rodas4(), initializealg = ShampineCollocationInit())
336-
sol = @inferred solve(proboop, Rodas5())
337-
sol = @inferred solve(proboop, Rodas4(), initializealg = ShampineCollocationInit())
335+
@test_broken sol = @inferred solve(prob, Rosenbrock23(autodiff=adalg))
336+
@test_broken sol = @inferred solve(prob, Rodas4(autodiff=adalg), initializealg = ShampineCollocationInit())
337+
@test_broken sol = @inferred solve(proboop, Rodas5())
338+
@test_broken sol = @inferred solve(proboop, Rodas4(), initializealg = ShampineCollocationInit())

0 commit comments

Comments
 (0)