Skip to content

Commit

Permalink
remove allocation tests due to flakieness
Browse files Browse the repository at this point in the history
  • Loading branch information
archermarx committed Aug 12, 2024
1 parent 49e6723 commit f6d2a5d
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,6 @@ include("unit_tests/test_walls.jl")
include("unit_tests/test_initialization.jl")
include("unit_tests/test_json.jl")

using Symbolics
include("order_verification/ovs_funcs.jl")
@testset "Order verification (electron energy)" begin
include("order_verification/ovs_energy.jl")
vfunc = x -> OVS_Energy.verify_energy(x)
refinements = refines(6, 20, 2)

cases = ["implicit", "Crank-Nicholson"]
norms_to_test = [1, 2, Inf]
num_norms = length(norms_to_test)

# Test spatial order of accuracy of implicit solver and crank-nicholson on L1, L2, and L∞ norms
slopes_nϵ, norms_nϵ = test_refinements(vfunc, refinements, norms_to_test)

# Check that electron energy equation is solved to at least first order in space
for (i, slope) in enumerate(slopes_nϵ)
norm_ind = mod1(i, num_norms)
case_ind = ((i-1) ÷ num_norms) + 1
println("Electron energy ($(cases[case_ind]), $(norms_to_test[norm_ind])-norm): ", slope)
@test slope > 0.8
end
end

function run_landmark(duration = 1e-3; ncells = 200, nsave = 2, dt = 0.7e-8, CFL = 0.799, case = 1)
domain = (0.0, 0.05)

Expand Down Expand Up @@ -135,13 +112,35 @@ using Printf
@printf("Ion current: %.3f ± %.3f A (expected %.3f A)\n", ji_mean, ji_err, ion_current)
println()
@test sol.retcode == :success
@test sol_info.bytes < 100e6 # should alloc less than 100 MB for this case
@test isapprox(thrust, T_mean, atol = T_err)
@test isapprox(current, Id_mean, atol = Id_err)
@test isapprox(ion_current, ji_mean, atol = ji_err)
end
end

using Symbolics
include("order_verification/ovs_funcs.jl")
@testset "Order verification (electron energy)" begin
include("order_verification/ovs_energy.jl")
vfunc = x -> OVS_Energy.verify_energy(x)
refinements = refines(6, 20, 2)

cases = ["implicit", "Crank-Nicholson"]
norms_to_test = [1, 2, Inf]
num_norms = length(norms_to_test)

# Test spatial order of accuracy of implicit solver and crank-nicholson on L1, L2, and L∞ norms
slopes_nϵ, norms_nϵ = test_refinements(vfunc, refinements, norms_to_test)

# Check that electron energy equation is solved to at least first order in space
for (i, slope) in enumerate(slopes_nϵ)
norm_ind = mod1(i, num_norms)
case_ind = ((i-1) ÷ num_norms) + 1
println("Electron energy ($(cases[case_ind]), $(norms_to_test[norm_ind])-norm): ", slope)
@test slope > 0.8
end
end

@testset "Order verification (neutrals and ions)" begin
include("order_verification/ovs_ions.jl")
refinements = refines(5, 10, 2)
Expand Down

2 comments on commit f6d2a5d

@archermarx
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/113002

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.16.6 -m "<description of version>" f6d2a5d9cb9c5b0c5f8eb24cd74e8e340ef8125d
git push origin v0.16.6

Please sign in to comment.