Skip to content
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

Worlds test can fail #39828

Closed
Keno opened this issue Feb 25, 2021 · 1 comment · Fixed by #39830
Closed

Worlds test can fail #39828

Keno opened this issue Feb 25, 2021 · 1 comment · Fixed by #39830
Assignees
Labels
ci Continuous integration test This change adds or pertains to unit tests

Comments

@Keno
Copy link
Member

Keno commented Feb 25, 2021

Seen locally:

worlds                            (11) |         failed at 2021-02-25T16:43:08.239
Error During Test at /Users/julia/julia-master/test/testdefs.jl:21
  Got exception outside of a @test
  LoadError: MethodError: no method matching worlds(::Nothing)
  Closest candidates are:
    worlds(!Matched::Core.MethodInstance) at /Users/julia/julia-master/test/worlds.jl:240
  Stacktrace:
   [1] top-level scope
     @ ~/julia-master/test/worlds.jl:317
  in expression starting at /Users/julia/julia-master/test/worlds.jl:317

This test relies on a specialization existing for +(::AbstractChar, ::UInt8), which seems like a bit of a random thing to ask for and it appears that in this particular run it didn't. I noticed that the original test had a call to Printf.gen, which I guess was supposed to force that specialization to exist. However, that was removed by @quinnj in 31d7210#diff-04a7474effdd5d726f96ff8ea1287744ee7258d4543d89571c76f3f5074c8bdc. Perhaps this should just literally use Core.Compiler.specialize_method?

@Keno Keno added test This change adds or pertains to unit tests ci Continuous integration labels Feb 25, 2021
timholy added a commit that referenced this issue Feb 25, 2021
@timholy
Copy link
Sponsor Member

timholy commented Feb 25, 2021

The method must have been invalidated since it's there in a fresh session:

$ ./julia --startup-file=no -q
julia> m = which(+, (Char, UInt8))
+(x::T, y::Integer) where T<:AbstractChar in Base at char.jl:235

julia> m.specializations
svec(MethodInstance for +(::Char, ::Int64), MethodInstance for +(::Char, ::UInt8), MethodInstance for +(::AbstractChar, ::UInt8), #undef, #undef, #undef, #undef, #undef)

That's a bit interesting in and of itself. At any rate, it's an excellent suggested fix, see #39830.

ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants