mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 13:22:55 +08:00
Remove unnecessary Task.Run
workaround in tests
This commit is contained in:
parent
8f91ce8f0c
commit
1fc4fa6820
@ -5,7 +5,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions;
|
||||
@ -84,11 +83,7 @@ namespace osu.Game.Tests.Database
|
||||
|
||||
realm.Run(r => r.Refresh());
|
||||
|
||||
// Without forcing the write onto its own thread, realm will internally run the operation synchronously, which can cause a deadlock with `WaitSafely`.
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await realm.WriteAsync(r => r.Add(TestResources.CreateTestBeatmapSetInfo()));
|
||||
}).WaitSafely();
|
||||
realm.WriteAsync(r => r.Add(TestResources.CreateTestBeatmapSetInfo())).WaitSafely();
|
||||
|
||||
realm.Run(r => r.Refresh());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user