1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 19:54:15 +08:00

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<int> 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.
This commit is contained in:
Bartłomiej Dach
2026-05-08 09:37:17 +02:00
Unverified
parent 26266321dd
commit b578d34da4
@@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
});
AddUntilStep("dialog visible", () => Game.ChildrenOfType<IDialogOverlay>().SingleOrDefault()?.CurrentDialog, Is.InstanceOf<SaveAndReloadEditorDialog>);
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<IDialogOverlay>().SingleOrDefault()?.CurrentDialog, Is.InstanceOf<SaveAndReloadEditorDialog>);
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", () =>
{