mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Remove unnecessary Task.Run
workaround in tests
This commit is contained in:
@ -5,7 +5,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@ -84,11 +83,7 @@ namespace osu.Game.Tests.Database
|
|||||||
|
|
||||||
realm.Run(r => r.Refresh());
|
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`.
|
realm.WriteAsync(r => r.Add(TestResources.CreateTestBeatmapSetInfo())).WaitSafely();
|
||||||
Task.Run(async () =>
|
|
||||||
{
|
|
||||||
await realm.WriteAsync(r => r.Add(TestResources.CreateTestBeatmapSetInfo()));
|
|
||||||
}).WaitSafely();
|
|
||||||
|
|
||||||
realm.Run(r => r.Refresh());
|
realm.Run(r => r.Refresh());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user