-
Notifications
You must be signed in to change notification settings - Fork 928
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
sbt reports success when forked test suite fails with an exception #2442
Comments
this makes me a bit nervous about switching scala/scala PR validation from ant to sbt, since sbt will be running some tests forked. did you do something special to work around this for Dotty? |
No, I just fixed the underlying issue that led to all these OutOfMemoryErrors. This looks like something that can only really be fixed in sbt itself. |
Note that this should be pretty rare: it happens when the test suite itself fails with an exception, not when a test fails with an exception. |
There was similar report with ScalaTest #1890 / scalatest/scalatest#432. |
SBT does not deal with exceptions in threads correctly, see: sbt/main/actions/src/main/scala/sbt/ForkTests.scala Lines 39 to 79 in a92e509
Acceptor is an instance of Runnable , in its run method you do not catch any exception, which mean that if one occurs, the thread dies, but nothing will be reported to the caller because you're just using Thread#run and Thread#join which don't report anything about how a Thread died.I don't know much about Java concurrency but I guess you could use https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.UncaughtExceptionHandler.html |
Seeing this with copycat + sbt as well https://circleci.com/gh/mediachain/mediachain/48 Definitely doesn't seem like the correct behavior |
@kevinmeredith Reading this issue over today, I now think #1890 is unrelated.
|
Fail when the forked test harness fails using NonFatal Fixes sbt#2442/sbt#2722 Add another fork-uncaught scripted test Originally from https://github.com/retronym/sbt-test-fork-swallows-error
See https://scala-ci.typesafe.com/job/dotty-master-validate-junit/1000/console for an example:
The text was updated successfully, but these errors were encountered: