Skip to content

How to detect if a CoroutineDispatcher is suspended due to a delay? #1919

@ZakTaccardi

Description

@ZakTaccardi

I want to be able to inform Espresso that it should not consider itself idle when there is an active coroutine with a specific name that is suspend due to a delay(..).

idlingDispatchers.reportNotIdleWhileCoroutineIsDelayed(
  CoroutineName("my_coroutine")
)

One way to achieve this would be to inject a custom delay(..) function, but I would prefer to avoid that to keep production code simple.

The difficulty I'm having is that I want to leverage the default behavior of DefaultDelay (which is internal) unless I am attempting to monitor a specific CoroutineName for idle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions