-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Uncompleted testBody in runBlockingTest not throwing UncompletedCoroutinesError #1881
Labels
Comments
dkhalanskyjb
added a commit
that referenced
this issue
Nov 1, 2021
dkhalanskyjb
added a commit
that referenced
this issue
Nov 17, 2021
dkhalanskyjb
added a commit
that referenced
this issue
Nov 17, 2021
dkhalanskyjb
added a commit
that referenced
this issue
Nov 19, 2021
yorickhenning
pushed a commit
to yorickhenning/kotlinx.coroutines
that referenced
this issue
Jan 28, 2022
This commit introduces the new version of the test module. Please see README.md and MIGRATION.md for a thorough discussion of the changes. Fixes Kotlin#1203 Fixes Kotlin#1609 Fixes Kotlin#2379 Fixes Kotlin#1749 Fixes Kotlin#1204 Fixes Kotlin#1390 Fixes Kotlin#1222 Fixes Kotlin#1395 Fixes Kotlin#1881 Fixes Kotlin#1910 Fixes Kotlin#1772 Fixes Kotlin#1626 Fixes Kotlin#1742 Fixes Kotlin#2082 Fixes Kotlin#2102 Fixes Kotlin#2405 Fixes Kotlin#2462 Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
pablobaxter
pushed a commit
to pablobaxter/kotlinx.coroutines
that referenced
this issue
Sep 14, 2022
This commit introduces the new version of the test module. Please see README.md and MIGRATION.md for a thorough discussion of the changes. Fixes Kotlin#1203 Fixes Kotlin#1609 Fixes Kotlin#2379 Fixes Kotlin#1749 Fixes Kotlin#1204 Fixes Kotlin#1390 Fixes Kotlin#1222 Fixes Kotlin#1395 Fixes Kotlin#1881 Fixes Kotlin#1910 Fixes Kotlin#1772 Fixes Kotlin#1626 Fixes Kotlin#1742 Fixes Kotlin#2082 Fixes Kotlin#2102 Fixes Kotlin#2405 Fixes Kotlin#2462 Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
runBlockingTest documentation states that it should throw
UncompletedCoroutinesError
if "testBody does not complete (or cancel)".I have instead found that it throws
IllegalStateException: This job has not completed yet
.Here is a simple test which reproduces.
@Test fun exampleFailure() = runBlockingTest { suspendCoroutine { } }
It is preferable to throw
UncompletedCoroutinesError
as it is a more precise exception to expect in a test for a coroutine that should not complete.The text was updated successfully, but these errors were encountered: