Fatal exceptions in tests are ignored #5379
Labels
bug
Something that is making a piece of functionality unusable
upstream-fix-needed
Waiting on a fix upstream
Milestone
Describe the bug
Create the following munit test...
Run it under Metals.
Result is...
Instead of reporting a failed test, the test is ignored and the suite completes semi-successfully. It also causes any other tests in the suite to be ignored so it's hard to realise that the tests are failing.
This exception is thrown if
--add-exports
is missing from code that requires it.Here you can see that
IllegalAccessError
is a subclass ofjava.lang.LinkageError
.Here you can see that
java.lang.LinkageError
is treated as fatal.Here, Munit only handles NonFatal errors.
Here JUnit runner does seem to report the error.
I'd add a stacktrace but there isn't one printed as it silently fails.
I'm not sure if this is an issue with Bloop, Metals, MUnit, JUnit or the way Scala classifies NonFatal errors.
Expected behavior
I think this type of error should be reported and the test should gracefully fail. It's not like we're out of memory.
Operating system
Windows
Editor/Extension
VS Code
Version of Metals
v0.11.12
Extra context or search terms
No response
The text was updated successfully, but these errors were encountered: