Skip to content

Commit f2d1029

Browse files
Kenoclaude
andcommitted
test: Ignore test-defined isequal methods in missing.jl's inference sweep
The all-methods return_types(isequal, Tuple{Any,Any}) sweep from #49800 asserts over every isequal method in the session - including ones added by OTHER test files sharing the worker process. test/arrayops.jl defines isequal(::totally_not_five26034, ::Number) (and its mirror), which infer Bool in isolation but degrade to Any once the LinearAlgebra tests have inflated the ==/Number method tables earlier in the same process. The failure therefore appears whenever the scheduler happens to run arrayops (after the LinearAlgebra tests) before missing on one worker - deterministically reproducible with JULIA_CPU_THREADS=1 julia test/runtests.jl LinearAlgebra/triangular2 \ LinearAlgebra/structuredbroadcast triplequote intrinsics iobuffer \ staged arrayops combinatorics euler client terminfo errorshow \ goto llvmcall some docs interpreter floatfuncs missing Restrict the assertion to methods owned by Base and the stdlibs (module root not Main); in a fresh process this still covers all 27 shipped methods. CI failure: https://buildkite.com/julialang/julia-pr/builds/392#019f59bc-668b-4c95-81ed-e80a15899a30 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KLwCBAR64r3cTdfaC5krU
1 parent 13ae271 commit f2d1029

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

test/missing.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,16 @@ end
8080
@test isapprox(missing, 1.0, atol=1e-6) === missing
8181
@test isapprox(1.0, missing, rtol=1e-6) === missing
8282

83-
@test all(==(Bool), Base.return_types(isequal, Tuple{Any,Any}))
83+
# Only assert the methods shipped with Base and the stdlibs: test files
84+
# that ran earlier in the same process may have added their own isequal
85+
# methods (e.g. arrayops' totally_not_five26034), and what those infer
86+
# depends on the session's accumulated method tables, not on `missing`.
87+
let ms = collect(methods(isequal, Tuple{Any,Any})),
88+
rts = Base.return_types(isequal, Tuple{Any,Any})
89+
@test all(zip(ms, rts)) do (m, rt)
90+
Base.moduleroot(parentmodule(m)) === Main || rt === Bool
91+
end
92+
end
8493
end
8594

8695
@testset "arithmetic operators" begin

0 commit comments

Comments
 (0)