-
Notifications
You must be signed in to change notification settings - Fork 6
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
runBlockingTestProvided() must add the TestCoroutineDispatcher to the context #15
Comments
Thanks for the report and minimum repro! I'll have a fix PR'd shortly. |
…to use TestCoroutineDispatcher (#16) * 1.0.0-beta01 (#12) * update copyright for 2020 * update codestyle * update versions for coroutines, kotlin, mockK, and misc. androidx * set jvm target to 1.6 * add Kdocs and ensure a blank line after copyright headers * add flowOn operators (#7) * add flowOn operators * add flowOn operators * scripts for publishing to maven central (#8) * kotlin gradle dsl (#9) * add kdocs to the test api functions (#11) * update copyright block in README * #15 Make TestBasicDispatcherProvider, update runBlockingProvided and runBlockingProvidedTest
* update copyright for 2020 * update codestyle * update versions for coroutines, kotlin, mockK, and misc. androidx * set jvm target to 1.6 * add Kdocs and ensure a blank line after copyright headers * add flowOn operators (#7) * add flowOn operators * add flowOn operators * scripts for publishing to maven central (#8) * kotlin gradle dsl (#9) * add kdocs to the test api functions (#11) * update Sample to use Maven Central versions of the project (#13) * CoroutineContext args for CoroutineScope factories (#14) * 1.0.0-beta01 (#12) * update copyright for 2020 * update codestyle * update versions for coroutines, kotlin, mockK, and misc. androidx * set jvm target to 1.6 * add Kdocs and ensure a blank line after copyright headers * add flowOn operators (#7) * add flowOn operators * add flowOn operators * scripts for publishing to maven central (#8) * kotlin gradle dsl (#9) * add kdocs to the test api functions (#11) * CoroutineContext args for CoroutineScope builders * #15 Make TestBasicDispatcherProvider, update runBlockingProvidedTest to use TestCoroutineDispatcher (#16) * 1.0.0-beta01 (#12) * update copyright for 2020 * update codestyle * update versions for coroutines, kotlin, mockK, and misc. androidx * set jvm target to 1.6 * add Kdocs and ensure a blank line after copyright headers * add flowOn operators (#7) * add flowOn operators * add flowOn operators * scripts for publishing to maven central (#8) * kotlin gradle dsl (#9) * add kdocs to the test api functions (#11) * update copyright block in README * #15 Make TestBasicDispatcherProvider, update runBlockingProvided and runBlockingProvidedTest * update kdoc to use `@see foo` instead of `see also [foo]` (#18) * add change log (#19) * update version to 1.0.0-beta2 (#17) * update version to 1.0.0-beta2 * change library version in the sample dependencies to be "1.+"
It should be fixed now in 1.0.0-beta02. Would you mind giving it a shot and confirming? Thanks again! |
Yep, perfect. Thanks for releasing a fix at warp speed ;-) By the way: you only released beta02 for |
Thanks for checking it out! I released both artifacts, and I'm able to import both of them now on my machine. I think someone at maven central just needed to flip their floppy disk over. |
Yep, seemed to be a maven central problem, by now it succeeded. |
The
TestCoroutineDispatcher
used to create theTestDispatcherProvider
is not added to the context. Since there is no existing dispatcher in the context, the calledrunBlockingTest()
will create its ownTestCoroutineDispatcher
.As a consequence, any calls to
advanceTime...()
will not work correctly since they are performed on a different dispatcher. The following test fails with anUncompletedCoroutinesError
In order to fix this situation, you must add the testDispatcher used for the provider also to the context, see this working example:
The text was updated successfully, but these errors were encountered: