Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential test failures due to Setup/SetUpSteps ordering #19453

Merged
merged 1 commit into from Jul 29, 2022

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Jul 29, 2022

Fixes https://teamcity.ppy.sh/buildConfiguration/Osu_Build/4290?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildTestsSection=true

Setup runs before SetUpSteps, and is used to reconstruct the testscene's dependencies, but the current screen hasn't been exited by this point. The above failure can be reproed in visual tests by running the test two times with:

diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs
index 228ecd4bf3..a24b1c44b9 100644
--- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs
+++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs
@@ -54,6 +54,12 @@ private void load([CanBeNull] IdleTracker idleTracker)
             AddInternal(selectionPollingComponent = new SelectionPollingComponent(Room));
         }

+        public override bool OnExiting(ScreenExitEvent e)
+        {
+            selectionPollingComponent.PollImmediately();
+            return base.OnExiting(e);
+        }
+
         protected override void LoadComplete()
         {
             base.LoadComplete();

The fix is to move all of this code to SetUpSteps. This may also fix other intermittent multiplayer tests, but unsure.

@peppy peppy enabled auto-merge July 29, 2022 06:42
@peppy peppy disabled auto-merge July 29, 2022 06:59
@peppy peppy merged commit be7a9e1 into ppy:master Jul 29, 2022
@smoogipoo smoogipoo deleted the multiplayer-test-misordering branch September 11, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants