mirror of https://github.com/ppy/osu
Remove synchronization context hacks in realm tests
This commit is contained in:
parent
1bb1366c9f
commit
ffd7877a1e
|
@ -87,11 +87,6 @@ public void TestBlockOperationsWithContention()
|
|||
|
||||
hasThreadedUsage.Wait();
|
||||
|
||||
// Usually the host would run the synchronization context work per frame.
|
||||
// For the sake of keeping this test simple (there's only one update invocation),
|
||||
// let's replace it so we can ensure work is run immediately.
|
||||
SynchronizationContext.SetSynchronizationContext(new ImmediateExecuteSynchronizationContext());
|
||||
|
||||
Assert.Throws<TimeoutException>(() =>
|
||||
{
|
||||
using (realm.BlockAllOperations())
|
||||
|
@ -107,10 +102,5 @@ public void TestBlockOperationsWithContention()
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private class ImmediateExecuteSynchronizationContext : SynchronizationContext
|
||||
{
|
||||
public override void Post(SendOrPostCallback d, object? state) => d(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue