From 10bd7176e015f63e4bf2dfa829db66ce6d4a71f4 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 23 Nov 2021 14:06:06 +0900 Subject: [PATCH] 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(); }); } ``` --- .../Multiplayer/TestSceneMultiplayerReadyButton.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs index e9612bf55c..84b63a5733 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs @@ -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