From 74a173cdfd2f0430c75d47760cf302fdbbae6f7b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 16 Jun 2025 15:36:55 +0900 Subject: [PATCH 1/3] Attempt to fix flaky editor test --- .../Visual/Editing/TestSceneEditorBeatmapCreation.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs index 2758954907..60898b7ec8 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs @@ -274,6 +274,14 @@ namespace osu.Game.Tests.Visual.Editing AddStep("save beatmap", () => Editor.Save()); AddStep("create new difficulty", () => Editor.CreateNewDifficulty(new ManiaRuleset().RulesetInfo)); + AddUntilStep("wait for created", () => + { + string? difficultyName = Editor.ChildrenOfType().SingleOrDefault()?.BeatmapInfo.DifficultyName; + return difficultyName != null && difficultyName != firstDifficultyName; + }); + + ensureEditorLoaded(); + AddStep("set unique difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName = firstDifficultyName); AddStep("add timing point", () => EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 })); AddStep("add effect points", () => From 54ef42a09e61cd4ca4133d0ee57c8d54c603a8e7 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 16 Jun 2025 16:21:27 +0900 Subject: [PATCH 2/3] Adjust condition to be more thorough --- osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs index 60898b7ec8..75b8554cd8 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs @@ -773,7 +773,7 @@ namespace osu.Game.Tests.Visual.Editing AddAssert("other audio not removed", () => Beatmap.Value.BeatmapSetInfo.Files.Any(f => f.Filename == "audio (1).mp3")); } - private void ensureEditorLoaded() => AddUntilStep("wait for editor load", () => Editor.IsLoaded && DialogOverlay.IsLoaded); + private void ensureEditorLoaded() => AddUntilStep("wait for editor load", () => Editor.ReadyForUse && DialogOverlay.IsLoaded); private void createNewDifficulty() { From 18195120ae0d74f2ceb5b0392d6982840d875fca Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 16 Jun 2025 16:29:08 +0900 Subject: [PATCH 3/3] Ensure editor is loaded in more places While I can't reproduce any test failures because of this, I can reproduce exceptions by simply running the tests with debugger attached. There's one other similar related test failure in `TestSingleAudioFile` but that appears to be an o!f issue. --- .../Visual/Editing/TestSceneEditorBeatmapCreation.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs index 75b8554cd8..8d7eb41369 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs @@ -232,8 +232,8 @@ namespace osu.Game.Tests.Visual.Editing EditorBeatmap.ControlPointInfo.Add(1500, new EffectControlPoint { KiaiMode = false, ScrollSpeed = 0.3 }); }); + ensureEditorLoaded(); AddStep("save beatmap", () => Editor.Save()); - AddStep("create new difficulty", () => Editor.CreateNewDifficulty(new ManiaRuleset().RulesetInfo)); AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog); @@ -293,8 +293,8 @@ namespace osu.Game.Tests.Visual.Editing EditorBeatmap.ControlPointInfo.Add(1500, new EffectControlPoint { KiaiMode = false, ScrollSpeed = 0.3 }); }); + ensureEditorLoaded(); AddStep("save beatmap", () => Editor.Save()); - AddStep("create new difficulty", () => Editor.CreateNewDifficulty(new TaikoRuleset().RulesetInfo)); AddUntilStep("wait for created", () => @@ -637,6 +637,8 @@ namespace osu.Game.Tests.Visual.Editing StartTime = 1000 } })); + + ensureEditorLoaded(); AddStep("save beatmap", () => Editor.Save()); AddStep("try to create new catch difficulty", () => Editor.CreateNewDifficulty(new CatchRuleset().RulesetInfo));