1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-08 07:03:38 +08:00
Commit Graph

6701 Commits

  • Attempt to fix editor navigation test failures again
    First of all, stop relying that `InputManager` will successfully press
    the gameplay test button, because it won't if it's obscured by the
    notification overlay. Closing the overlay in a loop doesn't work because
    there's a chance that a notification is posted, then all overlays are
    closed, then another notification is posted, and so the button still
    isn't clickable. Instead, use the `TestGameplay()` method directly.
    
    Secondly, the notifications will still block `EditorPlayerLoader` from
    transitioning to `EditorPlayer`. Here we have no other choice than to
    aggressively dismiss notifications every spin of the relevant until
    step and hope we eventually progress to `EditorPlayer`.
  • Fix flaky song select placeholder test by changing ruleset post-display
    Was failing occasionally due to the beatmap present operation causing
    the test's ruleset change to undo.
    
    ```csharp
    TearDown : System.TimeoutException : "wait for placeholder visible" timed out
    --TearDown
       at osu.Framework.Testing.Drawables.Steps.UntilStepButton.<>c__DisplayClass11_0.<.ctor>b__0()
       at osu.Framework.Testing.Drawables.Steps.StepButton.PerformStep(Boolean userTriggered)
       at osu.Framework.Testing.TestScene.runNextStep(Action onCompletion, Action`1 onError, Func`2 stopCondition)
    --- End of stack trace from previous location ---
       at osu.Framework.Testing.TestSceneTestRunner.TestRunner.RunTestBlocking(TestScene test)
       at osu.Game.Tests.Visual.OsuTestScene.OsuTestSceneTestRunner.RunTestBlocking(TestScene test) in /opt/buildagent/work/ecd860037212ac52/osu.Game/Tests/Visual/OsuTestScene.cs:line 503
       at osu.Framework.Testing.TestScene.RunTestsFromNUnit()
    ------- Stdout: -------
    [runtime] 2022-06-29 10:36:45 [verbose]: 💨 Class: TestScenePlaySongSelect
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔶 Test:  TestPlaceholderConvertSetting
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #1 exit all screens
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #2 reset defaults
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #3 delete all beatmaps
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #4 change ruleset to 2
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #5 import test map for ruleset 0
    [database] 2022-06-29 10:36:45 [verbose]: [efc1a] Beginning import from unknown...
    [database] 2022-06-29 10:36:45 [verbose]: [efc1a] Import successfully completed!
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #6 wait for imported to arrive in carousel
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #7 change convert setting
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #8 create song select
    [runtime] 2022-06-29 10:36:45 [verbose]: ScreenTestScene screen changed → TestScenePlaySongSelect+TestSongSelect
    [runtime] 2022-06-29 10:36:45 [verbose]: 📺 ScreenTestScene(OsuScreenStack)#338(depth:1) loading TestScenePlaySongSelect+TestSongSelect#263
    [runtime] 2022-06-29 10:36:45 [verbose]: decoupled ruleset transferred ("" -> "osu!catch")
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #9 wait for present
    [runtime] 2022-06-29 10:36:45 [verbose]: 📺 ScreenTestScene(OsuScreenStack)#338(depth:1) entered TestScenePlaySongSelect+TestSongSelect#263
    [runtime] 2022-06-29 10:36:45 [verbose]: 📺 BackgroundScreenStack#328(depth:1) loading BackgroundScreenBeatmap#338
    [runtime] 2022-06-29 10:36:45 [verbose]: 📺 BackgroundScreenStack#328(depth:1) entered BackgroundScreenBeatmap#338
    [runtime] 2022-06-29 10:36:45 [verbose]: Song select updating selection with beatmap:null ruleset:fruits
    [runtime] 2022-06-29 10:36:45 [verbose]: Song select changing beatmap from "please load a beatmap! - no beatmaps available!" to "null"
    [runtime] 2022-06-29 10:36:45 [verbose]: Song select working beatmap updated to Some Artist 0 - Some Song (set id 6224) ece7b702-895c-4f15-892f-05e4ff5e9a24 (Some Guy 3) [Normal 6224000 (length 0:50, bpm 106.7)]
    [runtime] 2022-06-29 10:36:45 [verbose]: Song select updating selection with beatmap:null ruleset:osu
    [runtime] 2022-06-29 10:36:45 [verbose]: decoupled ruleset transferred ("osu!catch" -> "osu!")
    [runtime] 2022-06-29 10:36:45 [verbose]: Song select updating selection with beatmap:74232aa2-2a1f-4920-b643-e85976838251 ruleset:osu
    [runtime] 2022-06-29 10:36:45 [verbose]: Song select decided to ensurePlayingSelected
    [runtime] 2022-06-29 10:36:45 [verbose]: Game-wide working beatmap updated to Some Artist 0 - Some Song (set id 6224) ece7b702-895c-4f15-892f-05e4ff5e9a24 (Some Guy 3) [Normal 6224000 (length 0:50, bpm 106.7)]
    [runtime] 2022-06-29 10:36:45 [debug]: Focus changed from nothing to SeekLimitedSearchTextBox.
    [network] 2022-06-29 10:36:45 [verbose]: Failing request osu.Game.Online.API.Requests.GetBeatmapRequest (System.InvalidOperationException: DummyAPIAccess cannot process this request.)
    [runtime] 2022-06-29 10:36:45 [verbose]: ✔️ 16 repetitions
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #10 wait for carousel loaded
    [runtime] 2022-06-29 10:36:45 [verbose]: 🔸 Step #11 wait for placeholder visible
    [runtime] 2022-06-29 10:36:55 [verbose]: 💥 Failed (on attempt 1,459)
    [runtime] 2022-06-29 10:36:55 [verbose]:  Currently loading components (0)
    [runtime] 2022-06-29 10:36:55 [verbose]: 🧵 Task schedulers
    [runtime] 2022-06-29 10:36:55 [verbose]: LoadComponentsAsync (standard) concurrency:4 running:0 pending:0
    [runtime] 2022-06-29 10:36:55 [verbose]: LoadComponentsAsync (long load) concurrency:4 running:0 pending:0
    [runtime] 2022-06-29 10:36:55 [verbose]: 🎱 Thread pool
    [runtime] 2022-06-29 10:36:55 [verbose]: worker:          min 1      max 32,767 available 32,766
    [runtime] 2022-06-29 10:36:55 [verbose]: completion:      min 1      max 1,000  available 1,000
    [runtime] 2022-06-29 10:36:55 [debug]: Focus on "SeekLimitedSearchTextBox" no longer valid as a result of unfocusIfNoLongerValid.
    [runtime] 2022-06-29 10:36:55 [debug]: Focus changed from SeekLimitedSearchTextBox to nothing.
    ```
  • Merge pull request #18915 from peppy/slider-snaking-test-refactoring
    Apply various refactorings to `TestSceneSliderSnaking`
  • Merge pull request #18914 from peppy/spectator-playback-test-leniences
    Increase leniences on `TestSceneSpectatorPlayback.TestWithSendFailure`
  • Increase leaniences on TestSceneSpectatorPlayback.TestWithSendFailure
    Not really sure how to improve this further, but should help with cases
    like this:
    
    ```csharp
    [runtime] 2022-06-28 05:32:06 [verbose]: 💨 Class: TestSceneSpectatorPlayback
    [runtime] 2022-06-28 05:32:06 [verbose]: 🔶 Test:  TestWithSendFailure
    [runtime] 2022-06-28 05:32:06 [verbose]: 🔸 Step #1 Setup containers
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 1 new frames (total 1 of 2)
    [runtime] 2022-06-28 05:32:06 [verbose]: 🔸 Step #2 received frames
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 7 of 8)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 13 of 19)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 19 of 29)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 25 of 44)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 31 of 45)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 37 of 59)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 43 of 67)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 49 of 125)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 55 of 126)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 61 of 127)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 67 of 128)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 73 of 129)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 79 of 130)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 85 of 131)
    [runtime] 2022-06-28 05:32:06 [verbose]: ✔️ 22 repetitions
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 91 of 132)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 97 of 133)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 103 of 134)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 109 of 135)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 115 of 136)
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 121 of 137)
    [runtime] 2022-06-28 05:32:06 [verbose]: 🔸 Step #3 start failing sends
    [runtime] 2022-06-28 05:32:06 [verbose]: Received 6 new frames (total 127 of 138)
    [runtime] 2022-06-28 05:32:06 [verbose]: 🔸 Step #4 wait for send attempts
    [runtime] 2022-06-28 05:32:06 [verbose]: 🔸 Step #5 frames did not increase
    [runtime] 2022-06-28 05:32:06 [verbose]: 💥 Failed
    [runtime] 2022-06-28 05:32:06 [verbose]:  Currently loading components (0)
    [runtime] 2022-06-28 05:32:06 [verbose]: 🧵 Task schedulers
    [runtime] 2022-06-28 05:32:06 [verbose]: LoadComponentsAsync (standard) concurrency:4 running:0 pending:0
    [runtime] 2022-06-28 05:32:06 [verbose]: LoadComponentsAsync (long load) concurrency:4 running:0 pending:0
    [runtime] 2022-06-28 05:32:06 [verbose]: 🎱 Thread pool
    [runtime] 2022-06-28 05:32:06 [verbose]: worker:          min 1      max 32,767 available 32,766
    [runtime] 2022-06-28 05:32:06 [verbose]: completion:      min 1      max 1,000  available 1,000
    [runtime] 2022-06-28 05:32:06 [verbose]: Host execution state changed to Stopping
    ```
    
    https://teamcity.ppy.sh/buildConfiguration/Osu_Build/811?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildTestsSection=true
  • Add logging around current channel changes and join requests
    Tracking down a flaky test
    (https://teamcity.ppy.sh/buildConfiguration/Osu_Build/553?hideProblemsFromDependencies=false&expandBuildTestsSection=true&hideTestsFromDependencies=false):
    
    ```csharp
    TearDown : System.TimeoutException : "PM Channel 1 displayed" timed out
    --TearDown
       at osu.Framework.Testing.Drawables.Steps.UntilStepButton.<>c__DisplayClass11_0.<.ctor>b__0()
       at osu.Framework.Testing.Drawables.Steps.StepButton.PerformStep(Boolean userTriggered)
       at osu.Framework.Testing.TestScene.runNextStep(Action onCompletion, Action`1 onError, Func`2 stopCondition)
    --- End of stack trace from previous location ---
       at osu.Framework.Testing.TestSceneTestRunner.TestRunner.RunTestBlocking(TestScene test)
       at osu.Game.Tests.Visual.OsuTestScene.OsuTestSceneTestRunner.RunTestBlocking(TestScene test) in /opt/buildagent/work/ecd860037212ac52/osu.Game/Tests/Visual/OsuTestScene.cs:line 503
       at osu.Framework.Testing.TestScene.RunTestsFromNUnit()
    ------- Stdout: -------
    [runtime] 2022-06-27 23:18:55 [verbose]: 💨 Class: TestSceneChatOverlay
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔶 Test:  TestKeyboardNextChannel
    [runtime] 2022-06-27 23:18:55 [verbose]: Chat is now polling every 60000 ms
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #1 Setup request handler
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #2 Add test channels
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #3 Show overlay with channels
    [runtime] 2022-06-27 23:18:55 [verbose]: Unhandled Request Type: osu.Game.Online.API.Requests.CreateChannelRequest
    [network] 2022-06-27 23:18:55 [verbose]: Failing request osu.Game.Online.API.Requests.CreateChannelRequest (System.InvalidOperationException: DummyAPIAccess cannot process this request.)
    [runtime] 2022-06-27 23:18:55 [verbose]: Unhandled Request Type: osu.Game.Online.API.Requests.CreateChannelRequest
    [network] 2022-06-27 23:18:55 [verbose]: Failing request osu.Game.Online.API.Requests.CreateChannelRequest (System.InvalidOperationException: DummyAPIAccess cannot process this request.)
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #4 Select channel 1
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #5 Channel 1 is visible
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #6 Press document next keys
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #7 Channel 2 is visible
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #8 Press document next keys
    [runtime] 2022-06-27 23:18:55 [verbose]: 🔸 Step #9 PM Channel 1 displayed
    [network] 2022-06-27 23:18:55 [verbose]: Request to https://a.ppy.sh/587 failed with System.Net.WebException: NotFound.
    [network] 2022-06-27 23:18:55 [verbose]: Request to https://a.ppy.sh/503 failed with System.Net.WebException: NotFound.
    [runtime] 2022-06-27 23:19:05 [verbose]: 💥 Failed (on attempt 5,550)
    [runtime] 2022-06-27 23:19:05 [verbose]:  Currently loading components (0)
    [runtime] 2022-06-27 23:19:05 [verbose]: 🧵 Task schedulers
    [runtime] 2022-06-27 23:19:05 [verbose]: LoadComponentsAsync (standard) concurrency:4 running:0 pending:0
    [runtime] 2022-06-27 23:19:05 [verbose]: LoadComponentsAsync (long load) concurrency:4 running:0 pending:0
    [runtime] 2022-06-27 23:19:05 [verbose]: 🎱 Thread pool
    [runtime] 2022-06-27 23:19:05 [verbose]: worker:          min 1      max 32,767 available 32,766
    [runtime] 2022-06-27 23:19:05 [verbose]: completion:      min 1      max 1,000  available 1,000
    [runtime] 2022-06-27 23:19:05 [debug]: Focus on "ChatTextBox" no longer valid as a result of unfocusIfNoLongerValid.
    [runtime] 2022-06-27 23:19:05 [debug]: Focus changed from ChatTextBox to nothing.
    ```
    
    This kind of logging should be helpful:
    
    ```csharp
    [runtime] 2022-06-28 04:59:57 [verbose]: 🔸 Step #5 Channel 1 is visible
    [runtime] 2022-06-28 04:59:57 [verbose]: 🔸 Step #6 Press document next keys
    [runtime] 2022-06-28 04:59:57 [verbose]: Current channel changed to #channel-2
    [runtime] 2022-06-28 04:59:57 [debug]: Pressed (DocumentNext) handled by TestSceneChatOverlay+TestChatOverlay.
    [runtime] 2022-06-28 04:59:57 [debug]: KeyDownEvent(PageDown, False) handled by ManualInputManager+LocalPlatformActionContainer.
    [runtime] 2022-06-28 04:59:57 [verbose]: 🔸 Step #7 Channel 2 is visible
    [runtime] 2022-06-28 04:59:57 [verbose]: 🔸 Step #8 Press document next keys
    [runtime] 2022-06-28 04:59:57 [verbose]: Current channel changed to test user 685
    [runtime] 2022-06-28 04:59:57 [debug]: Pressed (DocumentNext) handled by TestSceneChatOverlay+TestChatOverlay.
    [runtime] 2022-06-28 04:59:57 [debug]: KeyDownEvent(PageDown, False) handled by ManualInputManager+LocalPlatformActionContainer.
    [runtime] 2022-06-28 04:59:57 [verbose]: 🔸 Step #9 PM Channel 1 displayed
    [runtime] 2022-06-28 04:59:57 [verbose]: 🔸 Step #10 Press document next keys
    [runtime] 2022-06-28 04:59:57 [verbose]: Current channel changed to test user 218
    ```
  • Add messages to all InvalidOperationExceptions
    Without this, they can be very non-descript and hard to track down
  • Merge pull request #18864 from peppy/fix-realm-audio-track-test-fail
    Centralise and harden editor-ready-for-use check
  • Merge pull request #18866 from peppy/fix-storyboard-outro-skip-test-flaky
    Fix `TestStoryboardSkipOutro` occasionally failing due to strict timings
  • Centralise and harden editor-ready-for-use check
    Not only does this combine the check into one location, but it also adds
    a check on the global `WorkingBeatmap` being updated, which is the only
    way I can see the following failure happening:
    
    ```csharp
    05:19:07     osu.Game.Tests: osu.Game.Tests.Visual.Editing.TestSceneEditorBeatmapCreation.TestAddAudioTrack
    05:19:07       Failed TestAddAudioTrack [161 ms]
    05:19:07       Error Message:
    05:19:07        TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
    05:19:07       Stack Trace:
    05:19:07       --TearDown
    05:19:07        at osu.Game.Database.ModelManager`1.<>c__DisplayClass7_0.<AddFile>b__0(TModel managed) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 36
    05:19:07        at osu.Game.Database.ModelManager`1.<>c__DisplayClass8_0.<performFileOperation>b__0(Realm realm) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 49
    05:19:07        at osu.Game.Database.RealmExtensions.Write(Realm realm, Action`1 function) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\RealmExtensions.cs:line 14
    05:19:07        at osu.Game.Database.ModelManager`1.performFileOperation(TModel item, Action`1 operation) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 46
    05:19:07        at osu.Game.Database.ModelManager`1.AddFile(TModel item, Stream contents, String filename) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 36
    05:19:07        at osu.Game.Screens.Edit.Setup.ResourcesSection.ChangeAudioTrack(FileInfo source) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Screens\Edit\Setup\ResourcesSection.cs:line 115
    05:19:07        at osu.Game.Tests.Visual.Editing.TestSceneEditorBeatmapCreation.<TestAddAudioTrack>b__13_0() in C:\BuildAgent\work\ecd860037212ac52\osu.Game.Tests\Visual\Editing\TestSceneEditorBeatmapCreation.cs:line 101
    05:19:07        at osu.Framework.Testing.Drawables.Steps.AssertButton.checkAssert()
    05:19:07        at osu.Framework.Testing.Drawables.Steps.StepButton.PerformStep(Boolean userTriggered)
    05:19:07        at osu.Framework.Testing.TestScene.runNextStep(Action onCompletion, Action`1 onError, Func`2 stopCondition)
    ```
  • Merge pull request #18854 from peppy/fix-flaky-editor-navigation-test
    Attempt to fix flaky `EditorNavigation` test
  • Add timeout for all ManualResetEventSlim.Wait invocations
    Timeout values were taken as best-guesses of upper values we'd expect
    from sane execution.