1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 13:59:40 +08:00
Commit Graph

8491 Commits

Author SHA1 Message Date
Dean Herbert
ed1b809f54 Add missing request handling to actually join PM channels 2022-06-28 18:11:37 +09:00
Dean Herbert
21d31ee218 Ensure joined channels are actually joined to avoid unexpected tab order 2022-06-28 18:11:37 +09:00
Dan Balasescu
d630b62cfc
Merge pull request #18915 from peppy/slider-snaking-test-refactoring
Apply various refactorings to `TestSceneSliderSnaking`
2022-06-28 16:16:35 +09:00
Dan Balasescu
8e4a6c43b5
Merge pull request #18914 from peppy/spectator-playback-test-leniences
Increase leniences on `TestSceneSpectatorPlayback.TestWithSendFailure`
2022-06-28 16:15:51 +09:00
Dean Herbert
35745c83b7 Replace dodgy SetUpSteps overriding with usage of HasCustomSteps 2022-06-28 15:19:02 +09:00
Dean Herbert
a2701a3205 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
2022-06-28 14:58:34 +09:00
Dean Herbert
c1075d113f 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
```
2022-06-28 14:00:30 +09:00
Bartłomiej Dach
1a0228415d
Wait for and dismiss notification in editor navigation test 2022-06-27 22:29:47 +02:00
Dean Herbert
569fde4b47 Add messages to all InvalidOperationExceptions
Without this, they can be very non-descript and hard to track down
2022-06-28 01:34:25 +09:00
Dan Balasescu
396e7fc166
Merge pull request #18862 from peppy/empty-beatmap-file-fix-2
Fix second case of empty beatmaps being reported to sentry as errors
2022-06-27 20:37:57 +09:00
Dean Herbert
f355c3a3c9
Merge pull request #18864 from peppy/fix-realm-audio-track-test-fail
Centralise and harden editor-ready-for-use check
2022-06-27 19:42:49 +09:00
Dan Balasescu
e131101708
Merge pull request #18866 from peppy/fix-storyboard-outro-skip-test-flaky
Fix `TestStoryboardSkipOutro` occasionally failing due to strict timings
2022-06-27 18:33:02 +09:00
Dean Herbert
5af1106fa5 Remove unused using statement 2022-06-27 18:04:52 +09:00
Dean Herbert
401d9c1bae Fix TestStoryboardSkipOutro occasionally failing due to strict timings 2022-06-27 17:13:46 +09:00
Dean Herbert
8c3c1f095e Update rollback test expectations
I can't find a better way to do this. It's very hard to trigger an
actual failure in the import process these days. For now I've just made
this work with the new assumptions. May be worth removing the test in
the future if this ever backfires.
2022-06-27 17:04:35 +09:00
Dean Herbert
13dcaf82ad Fix chat tests failing 1/10000 runs
31a447fda0/osu.Game/Online/Chat/ChannelManager.cs (L412-L414)

Sigh.
2022-06-27 16:50:10 +09:00
Dean Herbert
5a7d339cc8 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)
```
2022-06-27 16:22:01 +09:00
Dean Herbert
b70b365411 Ensure files are cleaned up even on test step failure in TestAddAudioTrack 2022-06-27 15:53:05 +09:00
Dan Balasescu
05148d2b98
Merge pull request #18854 from peppy/fix-flaky-editor-navigation-test
Attempt to fix flaky `EditorNavigation` test
2022-06-27 13:58:28 +09:00
Dean Herbert
b5a8889fb8 Attempt to fix flaky EditorNavigation test
Conditionals taken from
f8830c6850/osu.Game/Tests/Visual/EditorTestScene.cs (L61-L62)
where it seemed to resolve other similar cases.
2022-06-27 03:04:50 +09:00
Dean Herbert
cd9eaf215b Attempt to fix flaky PlaylistOverlay test 2022-06-27 02:58:01 +09:00
Dean Herbert
31a447fda0 Update parameter discards 2022-06-24 21:26:19 +09:00
Dean Herbert
30eebf3511 Merge branch 'master' into c-sharp-10 2022-06-24 21:22:33 +09:00
Bartłomiej Dach
26c5b59f6d
Replace usages of string.To{Lower,Upper}() 2022-06-24 11:57:45 +02:00
Dan Balasescu
c7e92f46f4
Merge pull request #18819 from peppy/difficulty-icon-refactor-pass
Refactor difficulty icons to not suck
2022-06-24 17:50:50 +09:00
Dean Herbert
8912f07745 Merge branch 'master' into difficulty-icon-refactor-pass 2022-06-24 16:34:35 +09:00
Dean Herbert
545c04aaf5 Fix dangerous File.Copy causing intermittent realm migration test failures
Resolves an issue I've been able to locally reproduce on windows.
Basically, the `File.Copy` would begin while realm was blocking. The
"restore" operation is posted to the `SynchronizationContext` to run on
next update call, but in the mean time the copy would begin, causing a
conflict of interest.

Very dangerous. Only really noticeable on windows.
2022-06-24 16:18:56 +09:00
Dean Herbert
f71f6302fd Remove unnecessary null casts 2022-06-24 14:50:11 +09:00
Dean Herbert
ef258122d2 Move GetDifficultyRating helper method to StarDifficulty 2022-06-23 19:51:58 +09:00
Dean Herbert
01da6f20b3 Tidy up all remaining usages 2022-06-23 19:27:35 +09:00
Dean Herbert
7ef8b7df5f Add timeout for all ManualResetEventSlim.Wait invocations
Timeout values were taken as best-guesses of upper values we'd expect
from sane execution.
2022-06-23 14:46:00 +09:00
Dean Herbert
97fcf8cec9
Merge pull request #18668 from smoogipoo/editor-controlpoint-undo-redo 2022-06-23 04:02:24 +09:00
Bartłomiej Dach
a9f6eb0293
Add test coverage for new intended behaviour of sequential hotkey style 2022-06-21 15:18:37 +02:00
Bartłomiej Dach
a996325e19
Add test coverage for filter handling in classic style 2022-06-21 15:00:39 +02:00
Bartłomiej Dach
da1814e7c3
Restructure everything to fix free mod overlay issue 2022-06-21 14:48:41 +02:00
Bartłomiej Dach
143c8e8da6
Add test scene for desired classic selection behaviour 2022-06-21 13:35:00 +02:00
Bartłomiej Dach
658f5341c7
Set up flow for switching between hotkey styles 2022-06-21 13:34:58 +02:00
Bartłomiej Dach
73124d2b1f
Encapsulate mod hotkey selection logic in strategy pattern 2022-06-21 12:49:01 +02:00
Dean Herbert
10efb4bc6c Fix incorrect disposal in teardown steps 2022-06-21 14:08:30 +09:00
Bartłomiej Dach
21d60231b6
Add limited test coverage of osu:// scheme link IPC flow 2022-06-20 22:22:25 +02:00
Bartłomiej Dach
b0b3ea42cc
Remove null default value in ImportSkinTest helper method 2022-06-20 10:44:14 +02:00
Dan Balasescu
c402e90598
Merge pull request #18777 from peppy/output-directory-on-import-failure
Silence exception and provide more log output when import fails due to empty `.osu` files
2022-06-20 17:36:21 +09:00
Dan Balasescu
e0c82d11ab Convert == usages to ReferenceEquals 2022-06-20 16:56:19 +09:00
Dean Herbert
e82d948acc Add test coverage of import throwing when no valid .osu files are found 2022-06-20 16:06:22 +09:00
Dean Herbert
92f1a2958c Rename Import(TModel) to ImportModel to differentiate from other import methods 2022-06-20 15:18:07 +09:00
Dean Herbert
a6c8a832aa Remove Import(ArchiveReader) and redirect existing usages to Import(ImportTask) 2022-06-20 15:14:57 +09:00
Dean Herbert
7daab2d45b Merge branch 'master' into skin-editor-transform-fix 2022-06-20 14:10:01 +09:00
Dean Herbert
e4d0c7a0fb Move beatmap import step to only be required when entering gameplay 2022-06-20 14:08:05 +09:00
Dean Herbert
329f1a0822 Add test coverage of original fail case and improve test reliability and code quality 2022-06-20 14:08:05 +09:00
Dean Herbert
243806e810 Move common step of toggling skin editor to own method 2022-06-20 13:32:44 +09:00