From 66613cbaa4551c055a5e756787cb36ab0fe9072c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 6 Jan 2022 13:09:25 +0100 Subject: [PATCH] Wait for async continuation in score submission test The previous assert step was optimistically assuming that the async continuation that writes the value of `FakeImportingPlayer.ImportedScore` always completes before it, but that's not necessarily true even if the continuation is instant (it is still subject to things like task scheduling and TPL thread pool limits). To ensure no spurious failures, swap out the assert step for an until step instead. --- .../Visual/Gameplay/TestScenePlayerScoreSubmission.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs index 5ee1f9dd8f..cf5aadde6d 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs @@ -226,7 +226,7 @@ namespace osu.Game.Tests.Visual.Gameplay AddStep("exit", () => Player.Exit()); AddStep("allow import to proceed", () => Player.AllowImportCompletion.Release(1)); - AddAssert("ensure submission", () => Player.SubmittedScore != null && Player.ImportedScore != null); + AddUntilStep("ensure submission", () => Player.SubmittedScore != null && Player.ImportedScore != null); } [Test]