mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Fix intermittent failure in tests with restarting player instances
This commit is contained in:
@ -195,11 +195,17 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
AddUntilStep("wait for player", () =>
|
||||
{
|
||||
DismissAnyNotifications();
|
||||
return (player = Game.ScreenStack.CurrentScreen as Player) != null;
|
||||
player = Game.ScreenStack.CurrentScreen as Player;
|
||||
return player?.IsLoaded == true;
|
||||
});
|
||||
|
||||
AddAssert("retry count is 0", () => player.RestartCount == 0);
|
||||
|
||||
// todo: see https://github.com/ppy/osu/issues/22220
|
||||
// tests are supposed to be immune to this edge case by the logic in TestPlayer,
|
||||
// but we're running a full game instance here, so we have to work around it manually.
|
||||
AddStep("end spectator before retry", () => Game.SpectatorClient.EndPlaying(player.GameplayState));
|
||||
|
||||
AddStep("attempt to retry", () => player.ChildrenOfType<HotkeyRetryOverlay>().First().Action());
|
||||
AddUntilStep("wait for old player gone", () => Game.ScreenStack.CurrentScreen != player);
|
||||
|
||||
|
Reference in New Issue
Block a user