Method defintiion in test file fails on latest julia


#1

I’ve got some code that works correctly in Julia v1.0.2 but fails on nightly. I’ve asked about this in the slack and didn’t have CI traces, but now I do.

An example build that shows this failure is here:

https://travis-ci.org/polytomous/Ledecka.jl/builds/463075498

From latest, the failure is this:

┌ Warning: 🚡 Testing property method
│   method = some_property(x::Main.CoreTests.IntegerLessThan{100}) in Main.CoreTests at /home/travis/build/polytomous/Ledecka.jl/test/CoreTests.jl:64
└ @ Ledecka ~/build/polytomous/Ledecka.jl/src/quickcheck.jl:177
Core failure and passing scenarios: Error During Test at /home/travis/build/polytomous/Ledecka.jl/test/CoreTests.jl:72
  Got exception outside of a @test
  MethodError: no method matching warn_messages(::Type{Ledecka.LedeckaLib}, ::typeof(Main.CoreTests.some_property), ::Method, ::Type{Ledecka.ArbitraryUndefined})
  Closest candidates are:
    warn_messages(::Type{Ledecka.LedeckaLib}, ::Any, ::Method) at /home/travis/build/polytomous/Ledecka.jl/src/quickcheck.jl:145
    warn_messages(::Type{Ledecka.LedeckaLib}, ::Any, ::Any, !Matched::Type{X<:Ledecka.TestSuccess}) where X<:Ledecka.TestSuccess at /home/travis/build/polytomous/Ledecka.jl/src/quickcheck.jl:153
    warn_messages(::Type{Ledecka.LedeckaLib}, ::Any, ::Any, !Matched::Type{X<:Ledecka.TestFailure}) where X<:Ledecka.TestFailure at /home/travis/build/polytomous/Ledecka.jl/src/quickcheck.jl:161
    ...
  Stacktrace:
   [1] warn_messages(::getfield(Ledecka, Symbol("##26#33")){Method,Ledecka.ArbitraryUndefined}, ::Type{Ledecka.LedeckaLib}, ::Function, ::Method, ::Type) at /home/travis/build/polytomous/Ledecka.jl/src/quickcheck.jl:43
   [2] quickCheck(::Function) at /home/travis/build/polytomous/Ledecka.jl/src/quickcheck.jl:183
   [3] top-level scope at /home/travis/build/polytomous/Ledecka.jl/test/CoreTests.jl:73
   [4] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [5] top-level scope at /home/travis/build/polytomous/Ledecka.jl/test/CoreTests.jl:73
   [6] include at ./boot.jl:317 [inlined]
   [7] include_relative(::Module, ::String) at ./loading.jl:1038
   [8] include(::Module, ::String) at ./sysimg.jl:29
   [9] include(::String) at ./client.jl:403
   [10] top-level scope at /home/travis/build/polytomous/Ledecka.jl/test/runtests.jl:6
   [11] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [12] top-level scope at /home/travis/build/polytomous/Ledecka.jl/test/runtests.jl:6
   [13] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [14] top-level scope at /home/travis/build/polytomous/Ledecka.jl/test/runtests.jl:5
   [15] include at ./boot.jl:317 [inlined]
   [16] include_relative(::Module, ::String) at ./loading.jl:1038
   [17] include(::Module, ::String) at ./sysimg.jl:29
   [18] include(::String) at ./client.jl:403
   [19] top-level scope at none:0
   [20] eval(::Module, ::Any) at ./boot.jl:319
   [21] exec_options(::Base.JLOptions) at ./client.jl:243
   [22] _start() at ./client.jl:436

The trying to call arbitrary(IntegerLessThan), which is defined earlier in the test file. https://github.com/polytomous/Ledecka.jl/blob/d47050d40e9e1bce0c540b087416afb3fc9ab473/test/CoreTests.jl#L57 This method doesn’t get picked up in the latest julia, so the arbitrary call returns ArbitraryUndefined, thus causing this error. (If it doesn’t error here, (imagining i removed warn_messages) it will error deeper in the test with the same issue, when it attempts to call the ArbitraryUndefined)

A few other failures on this build seem to be caused by the same root cause.

Any ideas?