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

Fix potential test failure in TestSceneMultiplayerReadyButton

Couldn't exactly reproduce https://github.com/ppy/osu/runs/4294316800,
but I found a similar issue via:

```diff
diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs
index 84b63a5733..29cac9b061 100644
--- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs
+++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Linq;
+using System.Threading;
 using System.Threading.Tasks;
 using NUnit.Framework;
 using osu.Framework.Allocation;
@@ -81,6 +82,8 @@ private void load(GameHost host, AudioManager audio)

                         await Client.ToggleReady();

+                        Thread.Sleep(1000);
+
                         readyClickOperation.Dispose();
                     });
                 }
```
This commit is contained in:
Dan Balasescu 2021-11-23 14:06:06 +09:00
parent 8c24d6eb76
commit 10bd7176e0

View File

@ -9,6 +9,7 @@ using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Platform;
using osu.Framework.Testing;
using osu.Framework.Utils;
@ -198,11 +199,15 @@ namespace osu.Game.Tests.Visual.Multiplayer
}, users);
}
private void addClickButtonStep() => AddStep("click button", () =>
private void addClickButtonStep()
{
InputManager.MoveMouseTo(button);
InputManager.Click(MouseButton.Left);
});
AddUntilStep("wait for button to be ready", () => button.ChildrenOfType<Button>().Single().Enabled.Value);
AddStep("click button", () =>
{
InputManager.MoveMouseTo(button);
InputManager.Click(MouseButton.Left);
});
}
private void verifyGameplayStartFlow()
{