Need Help Testing Callback Style Code with Coroutines

This page summarizes the projects mentioned and recommended in the original post on /r/Kotlin

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • kotlinx.coroutines

    Library support for Kotlin coroutines

  • 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.

  • TaskAwaitIssue

    A repository that showcases main thread blocking issues with .await() in tests

  • 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

  • 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.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts