question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot call Delay twice in a unit test

See original GitHub issue

While working on a test that exercises code with delays, I ran into an issue where the test runners hangs when running more than 1 delay. I was able to reduce the issue to a simple test:

    [UnityTest]
    public IEnumerator DelayTwice() => UniTask.ToCoroutine(async () => {
      await UniTask.Delay(TimeSpan.FromSeconds(1));
      await UniTask.Delay(TimeSpan.FromSeconds(1));
    });

environment: Unity 2019

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
neuecccommented, Feb 26, 2021

v2.2.0 implements it.

0reactions
benoitdioncommented, Mar 1, 2021

Thank you! It might still be useful to show a warning letting the user know it’s happening since you’re now overriding an option specified

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Task.Delay() not behaving as expected
You have to interrupt your calling thread somehow. The unit test would terminate and the background thread as well. But if you call...
Read more >
Delay can't execute many delay at same time ? - Blueprint
So now i have time in game seconds when my delayed execution should happen. I set this value to some variable lets call...
Read more >
Component testing scenarios
Delayed change detection is intentional and useful. It gives the tester an opportunity to inspect and change the state of the component before...
Read more >
Testing your Compose layout | Jetpack Compose
Compose tests are synchronized by default with your UI. When you call an assertion or an action via the ComposeTestRule , the test...
Read more >
repeat
Defining two complex repeats with delays on the same source. Note that the second repeat cannot be called until the first repeat as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found