From 94d5e2f2642a531a08e5f31c932bf9be779d2afb Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 9 Mar 2022 00:48:03 +0900 Subject: [PATCH 1/2] Fix test failure ripple through entire TestScene --- .../Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs index 35992a0b38..5490c1e056 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs @@ -43,8 +43,6 @@ namespace osu.Game.Tests.Visual.Multiplayer Dependencies.Cache(rulesets = new RealmRulesetStore(Realm)); Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, Realm, rulesets, null, audio, Resources, host, Beatmap.Default)); Dependencies.Cache(Realm); - - beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely(); } [SetUp] @@ -52,8 +50,10 @@ namespace osu.Game.Tests.Visual.Multiplayer { AvailabilityTracker.SelectedItem.BindTo(selectedItem); + beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely(); importedSet = beatmaps.GetAllUsableBeatmapSets().First(); Beatmap.Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First()); + selectedItem.Value = new PlaylistItem(Beatmap.Value.BeatmapInfo) { RulesetID = Beatmap.Value.BeatmapInfo.Ruleset.OnlineID From 729af28a64c866f5eed51e9335ec151f5238d4b6 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 9 Mar 2022 00:48:12 +0900 Subject: [PATCH 2/2] Fix intermittent test failure --- .../Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs index 5490c1e056..c86d5e482a 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerReadyButton.cs @@ -92,16 +92,16 @@ namespace osu.Game.Tests.Visual.Multiplayer { OsuButton readyButton = null; - AddAssert("ensure ready button enabled", () => + AddUntilStep("ensure ready button enabled", () => { readyButton = button.ChildrenOfType().Single(); return readyButton.Enabled.Value; }); AddStep("delete beatmap", () => beatmaps.Delete(importedSet)); - AddAssert("ready button disabled", () => !readyButton.Enabled.Value); + AddUntilStep("ready button disabled", () => !readyButton.Enabled.Value); AddStep("undelete beatmap", () => beatmaps.Undelete(importedSet)); - AddAssert("ready button enabled back", () => readyButton.Enabled.Value); + AddUntilStep("ready button enabled back", () => readyButton.Enabled.Value); } [Test]