Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Oct 16, 2024

With this, the error message in https://buildkite.com/julialang/julia-master/builds/41054#019294ca-e2c5-41f2-a897-e2959715f154 would become

Error in testset errorshow:
Test Failed at /home/jishnu/juliaPR/usr/share/julia/test/errorshow.jl:226
  Expression: typeof(err) === $(Expr(:escape, :MethodError))
   Evaluated: StackOverflowError === MethodError
     Context: expr = :(+())

Having the failing expression displayed makes it easier to locate the source of the error.

@jishnub jishnub added ci Continuous integration error messages Better, more actionable error messages labels Oct 16, 2024
@vtjnash
Copy link
Member

vtjnash commented Oct 16, 2024

One testset per test seems overkill, but LGTM. We could also instead write this like we do in subtype.jl with the line number of the macro caller:

$(Expr(:macrocall, :var"@test", __source__, :($cmp(_type_intersect($a, $b), $result))))

@jishnub
Copy link
Member Author

jishnub commented Oct 17, 2024

Thanks for the suggestion! The error message becomes

Test Failed at /home/jishnu/juliaPR/usr/share/julia/test/errorshow.jl:1099
  Expression: typeof(err) === $(Expr(:escape, :MethodError))
   Evaluated: StackOverflowError === MethodError
     Context: expr = :(+())

In principle, the context is redundant if the line number is displayed, but having it displayed doesn't hurt anyway.

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Oct 17, 2024
@jishnub jishnub merged commit c4effc3 into master Oct 17, 2024
6 of 8 checks passed
@jishnub jishnub deleted the jishnub/errshow_msg branch October 17, 2024 11:13
@jishnub jishnub removed the merge me PR is reviewed. Merge when all tests are passing label Oct 17, 2024
KristofferC pushed a commit that referenced this pull request Oct 21, 2024
With this, the error message in
https://buildkite.com/julialang/julia-master/builds/41054#019294ca-e2c5-41f2-a897-e2959715f154
would become
```julia
Error in testset errorshow:
Test Failed at /home/jishnu/juliaPR/usr/share/julia/test/errorshow.jl:226
  Expression: typeof(err) === $(Expr(:escape, :MethodError))
   Evaluated: StackOverflowError === MethodError
     Context: expr = :(+())
```
Having the failing expression displayed makes it easier to locate the
source of the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration error messages Better, more actionable error messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants