1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

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.
This commit is contained in:
Bartłomiej Dach 2022-01-06 13:09:25 +01:00
parent 84765b99b3
commit 66613cbaa4
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -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]