From b578d34da42be5a673125165105d78cae6b72ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 8 May 2026 09:37:17 +0200 Subject: [PATCH] Attempt to fix flaky mania key count change test Can reproduce the failure via something like diff --git a/osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs b/osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs index fe5c437e40..92c58a7bde 100644 --- a/osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs +++ b/osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs @@ -187,13 +187,13 @@ private void updateKeyCount(ValueChangedEvent keyCount) { if (!t.GetResultSafely()) { - Schedule(() => + Scheduler.AddDelayed(() => { changeHandler!.RestoreState(-1); Beatmap.Difficulty.CircleSize = keyCount.OldValue; setStateFromActualKeyCount(keyCount.OldValue); updatingKeyCount = false; - }); + }, 1000); } else { so I'm banking on this being just a case of CI fuzzing the test by being slow. If the test fails again on this same assert after this change there are bigger problems at hand. But given the lack of local reproduction I'd rather start with this than spend an hour staring at it. --- .../Editor/TestSceneManiaEditorSaving.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/Editor/TestSceneManiaEditorSaving.cs b/osu.Game.Rulesets.Mania.Tests/Editor/TestSceneManiaEditorSaving.cs index 7b45d87c5e..b21928ef75 100644 --- a/osu.Game.Rulesets.Mania.Tests/Editor/TestSceneManiaEditorSaving.cs +++ b/osu.Game.Rulesets.Mania.Tests/Editor/TestSceneManiaEditorSaving.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor }); AddUntilStep("dialog visible", () => Game.ChildrenOfType().SingleOrDefault()?.CurrentDialog, Is.InstanceOf); AddStep("refuse", () => InputManager.Key(Key.Number2)); - AddAssert("key count is 5", () => keyCount.Current.Value, () => Is.EqualTo(5)); + AddUntilStep("key count is 5", () => keyCount.Current.Value, () => Is.EqualTo(5)); AddStep("change key count to 8 again", () => { @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor }); AddUntilStep("dialog visible", () => Game.ChildrenOfType().SingleOrDefault()?.CurrentDialog, Is.InstanceOf); AddStep("refuse", () => InputManager.Key(Key.Number2)); - AddAssert("key count is 5", () => keyCount.Current.Value, () => Is.EqualTo(5)); + AddUntilStep("key count is 5", () => keyCount.Current.Value, () => Is.EqualTo(5)); AddStep("set dual stages again", () => {