Fork in test should handle exceptions during creation of test class
See original GitHub issueWe recently ran into a pretty severe issue where a ScalaTest test class was throwing a NPE during construction, which caused test execution to stop but for success to be reported. This meant that we were running 1/3 of our test suite instead of the full test suite and failures were not reported. Note that this was a multi-module build.
I can provide a simple test case if that helps.
The output was:
Exception in thread "Thread-32" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2571)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1315)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at sbt.React.react(ForkTests.scala:98)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.run(ForkTests.scala:66)
at java.lang.Thread.run(Thread.java:722)
Exception in thread "Thread-32" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2571)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1315)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at sbt.React.react(ForkTests.scala:98)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.run(ForkTests.scala:66)
at java.lang.Thread.run(Thread.java:722)
[info] Passed: : Total 0, Failed 0, Errors 0, Passed 0, Skipped 0
Issue Analytics
- State:
- Created 11 years ago
- Comments:29 (13 by maintainers)
Top Results From Across the Web
Exception handling in test class. How to write the test class for ...
Exception class, you can construct most (if not all) of the more specific exception classes (like System.DmlException ). Your output here is ...
Read more >Handling exceptions in tests: Junit & Kotest - Kotlin Testing
Exceptions are crucial part of some Java APIs. How to assert that exceptions was thrown? In this note you will examples of various...
Read more >Maven Surefire Plugin – Fork Options and Parallel Test ...
The surefire offers a variety of options to execute tests in parallel, allowing you to make best use of the hardware at your...
Read more >Built-in Exceptions — Python 3.11.1 documentation
In Python, all exceptions must be instances of a class that derives from ... This can be used to test an exception handler...
Read more >All you need to know about Data-Driven Testing - Testsigma
Data-driven or parameterized testing is a way to automate the creation, use, ... and impossible to manage when you have to run through...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seeing this with increasing regularity, typically in CID.
I am still facing issue when using fork in Test := true
Can some one please suggest the fix.