Skip to content
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

[Bug]: DataStore 1.1.1 update broke unit tests #1647

Closed
3 tasks done
SimonMarquis opened this issue Sep 30, 2024 · 1 comment · Fixed by #1648
Closed
3 tasks done

[Bug]: DataStore 1.1.1 update broke unit tests #1647

SimonMarquis opened this issue Sep 30, 2024 · 1 comment · Fixed by #1648
Labels
bug Something isn't working

Comments

@SimonMarquis
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

The following update broke unit tests:

The changelog mentions:

Performance improvement on DataStore only collects update notifications when it is observed. (b/267792241)
Note that this change might trigger UncompletedCoroutinesError in your tests if you are using the Coroutines testing library. Make sure you pass the TestScope.backgroundScope when initializing DataStore in your tests to avoid this issue.

Relevant logcat output

After waiting for 1m, there were active child jobs: ["coroutine#37":StandaloneCoroutine{Active}@1bbe97e2]. Use `TestScope.backgroundScope` to launch the coroutines that need to be cancelled when the test body finishes
kotlinx.coroutines.test.UncompletedCoroutinesError: After waiting for 1m, there were active child jobs: ["coroutine#37":StandaloneCoroutine{Active}@1bbe97e2]. Use `TestScope.backgroundScope` to launch the coroutines that need to be cancelled when the test body finishes
	at app//kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$2.invokeSuspend$lambda$0(TestBuilders.kt:354)
	at app//kotlinx.coroutines.InvokeOnCancelling.invoke(JobSupport.kt:1571)
	at app//kotlinx.coroutines.JobSupport.notifyCancelling(JobSupport.kt:1604)
	at app//kotlinx.coroutines.JobSupport.tryMakeCancelling(JobSupport.kt:826)
	at app//kotlinx.coroutines.JobSupport.makeCancelling(JobSupport.kt:786)
	at app//kotlinx.coroutines.JobSupport.cancelImpl$kotlinx_coroutines_core(JobSupport.kt:702)
	at app//kotlinx.coroutines.JobSupport.cancelCoroutine(JobSupport.kt:689)
	at app//kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:156)
	at app//kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:505)
	at app//kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
	at app//kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:105)
	at [email protected]/java.lang.Thread.run(Thread.java:833)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@SimonMarquis
Copy link
Contributor Author

SimonMarquis commented Sep 30, 2024

There is also a badging change that was not applied, failing the build at a later step.
Nevermind, the badging file was changed because of some ordering rule that changed because of the updated DataStore dependency. It is now fixed in the same PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant