Cannot call Delay twice in a unit test
See original GitHub issueWhile 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:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
v2.2.0 implements it.
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