Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I've been banging my head against this problem for more time than I care to admit, so putting this out there to hopefully get some more ideas. I am trying to create an integration test that involves pre-populating data in my local Firestore emulator, and then calling a method to retrieve a subset of results. Firestore uses callback listeners to handle logic relating to the results of these operations. However, there is a Kotlin coroutines package: kotlinx-coroutines-play-services, that provides an extension function to ".await()" for a result, rather than rely on the callback flow.
My problem comes into play when I am writing the tests. When the tests run, .await() never finishes, so my tests hang indefinitely. I created a small repo to showcase this problem: https://github.com/pmoons/TaskAwaitIssue
Related posts
- Gradle: from Newbie to Strong fundamentals
- Add `statefulMap` and `statefulTransform` operator to Kotlin coroutines' Flow
- Should I choose Kotlin over Java for a new project (backend)?
- kotlinx.coroutines 1.7.0 released
- Is it ok to have global scopes when the coroutine I'm starting has *nothing* to do with showing UI, nor do I care about its result?