-
Notifications
You must be signed in to change notification settings - Fork 649
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
Error in beforeTest listener is swallowed #1381
Comments
There's plenty of tests around this, I will investigate. |
Interesting, the plot thickens. So i ran that test, in the kotest repo to see if its a platform issue (java version or windows related), and it passes ok. I then tried to run my failing test through I then ran my failing test again through Android Studio and it worked :/ weird... I did a Then i tried Then after doing a Gradle version 6.3 here, i don't know enough about gradle to understand this. Which version of gradle do you use so i can try that? |
Aha, it has to do with the type of exception thrown from the beforeTest block. RuntimeException works as expected. Can you confirm this your side? I beleive regardless of the type of exception thrown during the setup, the tests should always finish and spit out that exception on the console somehow. |
I'll need to add more tests. The code catches Throwable so it should catch
anything. I don't see why ExceptionInInitializerError would break it.
…On Tue, 14 Apr 2020 at 02:37, Oliver Culley de Lange < ***@***.***> wrote:
Aha, it has to do with the type of exception thrown from the beforeTest
block.
RuntimeException works as expected.
ExceptionInInitializerError makes everything go a bit haywire... and this
is the exception that was being thrown from my test.
Can you confirm this your side?
I beleive regardless of the type of exception thrown during the setup, the
tests should always finish and spit out that exception on the console
somehow.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1381 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGRIMGQQ5623R47Q6L3RMQHC7ANCNFSM4MHAWJOA>
.
|
@sksamuel ExceptionInInitializerError extends LinkageError which in jvm platform implementation of Try, we have marked it nonfatal error I think that's the reason it gets swallowed in beforeTest kotest/kotest-fp/src/commonMain/kotlin/io/kotest/fp/Try.kt Lines 10 to 14 in e176cc3
kotest/kotest-fp/src/jvmMain/kotlin/io/kotest/fp/nonFatal.kt Lines 3 to 6 in e176cc3
https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html |
I'm releasing 4.0.4 with this fix.
…On Thu, 23 Apr 2020 at 05:01, ashish kumar joy ***@***.***> wrote:
@sksamuel <https://github.com/sksamuel> ExceptionInInitializerError
extends LinkageError which in jvm platform implementation of Try, we have
marked it nonfatal error I think that's the reason it gets swallowed in
beforeTest
https://github.com/kotest/kotest/blob/e176cc3e14364d74ee593533b50eb9b08df1f5d1/kotest-fp/src/commonMain/kotlin/io/kotest/fp/Try.kt#L10-L14
https://github.com/kotest/kotest/blob/e176cc3e14364d74ee593533b50eb9b08df1f5d1/kotest-fp/src/jvmMain/kotlin/io/kotest/fp/nonFatal.kt#L3-L6
https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1381 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGVNWIQQEG634OTN2WDROAGXDANCNFSM4MHAWJOA>
.
|
Kotest 4.0.2
I run a test which throws an exception in my
beforeTest{}
setup steps, however the process finishes with exit code 0, and no error is printed to console.Example:
Gives:
The text was updated successfully, but these errors were encountered: