1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 04:07:26 +08:00
Commit Graph

33836 Commits

Author SHA1 Message Date
Dean Herbert
32af4e41ea Add back thread safety and locking as required 2022-06-29 20:56:01 +09:00
Dean Herbert
e10ac45fd7 Remove probably redundant realmLock
As far as I can tell all accesses are safe due to update thread
guarantees. The only weird one may be async writes during a
`BlockAllOperations`, but the `Compact` loop should handle this quite
amicably.
2022-06-28 16:55:54 +09:00
Dean Herbert
83982d258d Throw immediately if attempting to WriteAsync after disposed 2022-06-27 19:34:28 +09:00
Dean Herbert
c39c99bd43 Ensure all async writes are completed before realm is disposed 2022-06-27 19:21:05 +09:00
Dan Balasescu
8f91ce8f0c
Merge pull request #18871 from peppy/fix-realm-assertion-during-tests
Fix occasional failure in realm test proceedings due to incorrect `Debug.Assert`
2022-06-27 18:48:47 +09:00
Dan Balasescu
b13fa924fd
Merge pull request #18865 from peppy/fix-flaky-chat-test
Fix chat tests failing 1/10000 runs
2022-06-27 18:06:00 +09:00
Dean Herbert
f6a61472c4 Fix occasional failure in realm test proceedings due to incorrect Debug.Assert
After a `BlockAllOperations`, the restoration of the `updateRealm`
instance is not instance. It is posted to a `SynchronizationContext`.
The assertion which has been removed in this commit was assuming it
would always be an immediate operation.

To ensure this works as expected, I've tracked the initialised state via
a new `bool`.

```csharp
System.TimeoutException : Attempting to block for migration took too long.

  1) Host threw exception System.AggregateException: One or more errors occurred. (: )
 ---> NUnit.Framework.AssertionException: :
   at osu.Framework.Logging.ThrowingTraceListener.Fail(String message1, String message2)
   at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage)
   at System.Diagnostics.TraceInternal.TraceProvider.Fail(String message, String detailMessage)
   at System.Diagnostics.Debug.Fail(String message, String detailMessage)
   at osu.Game.Database.RealmAccess.BlockAllOperations() in /opt/buildagent/work/ecd860037212ac52/osu.Game/Database/RealmAccess.cs:line 813
   at osu.Game.OsuGameBase.<>c__DisplayClass108_1.<Migrate>b__0() in /opt/buildagent/work/ecd860037212ac52/osu.Game/OsuGameBase.cs:line 449
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
   at osu.Framework.Threading.Scheduler.Update()
   at osu.Framework.Graphics.Drawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
```

https://teamcity.ppy.sh/buildConfiguration/Osu_Build/322?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildTestsSection=true
2022-06-27 18:01:12 +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
Dan Balasescu
0fd2c010e5 Remove NRT disables from attributes classes 2022-06-27 16:07:15 +09:00
Dan Balasescu
0579780bb8 Add IBeatmapOnlineInfo parameter and use to extract more data 2022-06-27 16:07:15 +09:00
Dan Balasescu
f6a6538e96 Add more properties to IBeatmapOnlineInfo 2022-06-27 16:07:15 +09:00
Dan Balasescu
2b278ed324
Merge pull request #18841 from peppy/menu-cursor-better-rotation
Adjust menu cursor rotation to use a floating centre-point
2022-06-27 14:18:54 +09:00
Dean Herbert
1a22377e19 Fix test deadlock due to TPL threadpool saturation
As found in aggressive CI runs:

```csharp
00007F6F527F32B0 00007f74f937c72d (MethodDesc 00007f74f5545a78 + 0x22d System.Threading.ManualResetEventSlim.Wait(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007f74f51c0838 + 0 System.Threading.Monitor.Wait(System.Object, Int32))
00007F6F527F3330 00007f74f93861ca (MethodDesc 00007f74f5259100 + 0x10a System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007f74f5545a78 + 0 System.Threading.ManualResetEventSlim.Wait(Int32, System.Threading.CancellationToken))
00007F6F527F3390 00007f74f9385d11 (MethodDesc 00007f74f52590e8 + 0x81 System.Threading.Tasks.Task.InternalWaitCore(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007f74f5259100 + 0 System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken))
00007F6F527F33E0 00007f74fc3823af (MethodDesc 00007f74f5934c08 + 0x4f System.Threading.Tasks.Task`1[[System.Boolean, System.Private.CoreLib]].GetResultCore(Boolean)), calling (MethodDesc 00007f74f52590e8 + 0 System.Threading.Tasks.Task.InternalWaitCore(Int32, System.Threading.CancellationToken))
00007F6F527F3400 00007f74fb0aad92 (MethodDesc 00007f74fb28b000 + 0x122 osu.Game.Tests.Visual.OnlinePlay.OnlinePlayTestScene+<>c__DisplayClass21_0.<Setup>b__1(osu.Game.Online.API.APIRequest)), calling (MethodDesc 00007f74f5934be8 + 0 System.Threading.Tasks.Task`1[[System.Boolean, System.Private.CoreLib]].get_Result())
00007F6F527F3470 00007f74fa9c6dd7 (MethodDesc 00007f74f921f6c8 + 0x77 osu.Game.Online.API.DummyAPIAccess.PerformAsync(osu.Game.Online.API.APIRequest))
00007F6F527F34C0 00007f74fb13c718 (MethodDesc 00007f74fb4e0c50 + 0x538 osu.Game.Database.OnlineLookupCache`3+<performLookup>d__13[[System.Int32, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]].MoveNext())
```

Going with the simplest solution, as what we had was pretty ugly to start with and I don't want to overthink this, just push a fix and hope for the best.
2022-06-26 16:42:29 +09:00
Dean Herbert
2ecab454aa Adjust animations and tolerances to make things feel snappier 2022-06-25 19:50:10 +09:00
Dean Herbert
a039f9878a Adjust menu cursor rotation to follow mouse, rather than be fixated around original click location 2022-06-25 19:33:44 +09:00
Bartłomiej Dach
a83c45b50e
Fix compile failures from framework breaking change 2022-06-24 16:07:14 +02:00
Bartłomiej Dach
df30bedab6
Update framework again 2022-06-24 16:01:52 +02:00
Dean Herbert
14327943a2 Update framework 2022-06-24 21:28:30 +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
Dean Herbert
2ca4184eda
Merge pull request #18834 from bdach/ban-implicit-to-lower-upper
Disallow usage of `string.To{Upper,Lower}()` without explicit culture
2022-06-24 20:39:58 +09:00
Dan Balasescu
7eb49dac7a
Merge pull request #18832 from peppy/bdc-remove-unused-path
Remove unused bindable retrieval flow in `BeatmapDifficultyCache`
2022-06-24 20:20:23 +09:00
Dean Herbert
823b3c1c0f Ensure WorkingBeatmap is always using a detached instance 2022-06-24 19:07:54 +09:00
Dean Herbert
2ae48d5a87 Rename incorrect parameter name in BeatmapManager.GetWorkingBeatmap 2022-06-24 19:07:54 +09:00
Bartłomiej Dach
26c5b59f6d
Replace usages of string.To{Lower,Upper}() 2022-06-24 11:57:45 +02:00
Dean Herbert
c179127670 Remove unused bindable retrieval flow 2022-06-24 17:09:56 +09:00
Dean Herbert
0755430006 Use AddOnce for update calls 2022-06-24 17:09:56 +09:00
Dean Herbert
8912f07745 Merge branch 'master' into difficulty-icon-refactor-pass 2022-06-24 16:34:35 +09:00
Dean Herbert
f71f6302fd Remove unnecessary null casts 2022-06-24 14:50:11 +09:00
Dean Herbert
28837693e5 Nuke calculating everything
The whole component is pointless so I'm just going to nuke for now I
guess. Kind of makes the whole refactor effort pointless but oh well?

To expand on this, the implementation was actually incorrect as pointed
out at https://github.com/ppy/osu/pull/18819#pullrequestreview-1017886035.
2022-06-24 14:24:06 +09:00
Dean Herbert
12ea8369ee Update retriever to be relatively sized 2022-06-24 14:06:31 +09:00
Dean Herbert
d9c1a9d71f Use new property to specify no tooltip, rather than passing only ruleset 2022-06-24 14:06:18 +09:00
Dean Herbert
129c907092 Remove unused parameters 2022-06-24 13:58:02 +09:00
Dean Herbert
730228ec2a
Merge pull request #18818 from nekodex/rearrangeable-list-feedback
Add audio feedback for rearranging list items
2022-06-23 23:30:55 +09:00
Jamie Taylor
aaf619b35c
Don't play sample if there is no item being actively dragged 2022-06-23 20:13:01 +09:00
Jamie Taylor
9c46592e0e
Move collection change event binding to LoadComplete 2022-06-23 20:04:54 +09:00
Dean Herbert
ef258122d2 Move GetDifficultyRating helper method to StarDifficulty 2022-06-23 19:51:58 +09:00
Dean Herbert
b068df2149 Enable NRT on BeatmapDiffiultyCache 2022-06-23 19:51:58 +09:00
Dean Herbert
32652ace75 Update resources 2022-06-23 19:51:44 +09:00
Dean Herbert
01da6f20b3 Tidy up all remaining usages 2022-06-23 19:27:35 +09:00
Dean Herbert
7dec530ca5 Split out simple DifficultyIcon with no calculation overhead and update usages 2022-06-23 19:27:35 +09:00
Dean Herbert
4a2ca4394b Remove unused ModeTypeInfo class 2022-06-23 19:27:35 +09:00
Dean Herbert
3a83e5684c Tidy up DifficultyIcon 2022-06-23 19:27:35 +09:00
Dean Herbert
d6b073ebad Move DifficultyRetrieve to own class and split both pathways into separate constructors 2022-06-23 19:27:35 +09:00
Jamie Taylor
4a316fad2f
Add audio feedback for rearranging list items 2022-06-23 17:45:42 +09:00
Dean Herbert
158f0a1f23 Remove remaining Room!=null checks in TestMultiplayerClient where possible 2022-06-23 17:38:34 +09:00
Dan Balasescu
9ed37621a7
Merge pull request #18816 from peppy/avoid-waiting-forever
Ban usage of `ManualResetEventSlim.Wait()` without a timeout value
2022-06-23 17:26:26 +09:00
Dean Herbert
51268d0cc8 Throw on Wait failure in a few remaining cases 2022-06-23 15:28:21 +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
bc557bacf0 Remove room null assertion in TestMultiplayerClient.ChangeState to avoid assert
This method is run from async contexts, but `get_Room` asserts update
thread which is not the case. Was causing silent test failures (showing
as pass but failing `dotnet-test` via return code):

TestSceneMultiplayer.TestGameplayFlow

```
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: Score preparation failed!
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: NUnit.Framework.AssertionException: :
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Framework.Logging.ThrowingTraceListener.Fail(String message1, String message2)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at System.Diagnostics.TraceInternal.TraceProvider.Fail(String message, String detailMessage)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at System.Diagnostics.Debug.Fail(String message, String detailMessage)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Online.Multiplayer.MultiplayerClient.get_Room() in /opt/buildagent/work/ecd860037212ac52/osu.Game/Online/Multiplayer/MultiplayerClient.cs:line 98
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Tests.Visual.Multiplayer.TestMultiplayerClient.ChangeState(MultiplayerUserState newState) in /opt/buildagent/work/ecd860037212ac52/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs:line 275
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Screens.OnlinePlay.Multiplayer.MultiplayerPlayer.PrepareScoreForResultsAsync(Score score) in /opt/buildagent/work/ecd860037212ac52/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs:line 223
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Screens.Play.Player.prepareScoreForResults() in /opt/buildagent/work/ecd860037212ac52/osu.Game/Screens/Play/Player.cs:line 747
```
2022-06-23 14:10:20 +09:00