Open harshal-msf opened 4 months ago
The fix is what the exception says: don't throw any exceptions before runTest
starts. Exceptions thrown before runTest
begins are always considered to be errors.
Yes Exceptions is self-explanatory. However, when I implemented a try-catch block to check for suppressed exceptions, none were returned. Despite observing that suppressed exceptions are added in TestScope.enter(), none are being printed. Not sure am i missing any step?
Interesting. Do you observe suppressed exceptions if you add Thread.sleep(1000)
just before runTest
?
Need to check this i will check this and update accordingly.
@harshal-msf, any updates?
Observation: When I correct a test that throws the "UncaughtExceptionsBeforeTest" exception, it passes, but then another test in a different class fails with the same exception. Fixing the new failing test causes another to fail, and this cycle continues.
Things which i have tried to solve this issue:
Bump kotlinxCoroutinesTest version to 1.8.0
Running failed tests which has runTest method inside try catch block to check all suppressed exception.
Checked if any exception is thrown before and added that same exception in try catch block.
Used Test dispatcher rule which make tests run on same coroutine.
Is there anything i'm missing, to solve this issue i checked all previous issues conversations and applied those fixes which mentioned in the conversation still getting this same issue.