mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 18:47:27 +08:00
Merge pull request #19868 from peppy/fix-test-deadlocks
Add safeties to avoid deadlock in `SubmittingPlayer`
This commit is contained in:
commit
b81c7ffc60
@ -128,5 +128,13 @@ namespace osu.Game.Online.API
|
|||||||
IBindable<UserActivity> IAPIProvider.Activity => Activity;
|
IBindable<UserActivity> IAPIProvider.Activity => Activity;
|
||||||
|
|
||||||
public void FailNextLogin() => shouldFailNextLogin = true;
|
public void FailNextLogin() => shouldFailNextLogin = true;
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
// Ensure (as much as we can) that any pending tasks are run.
|
||||||
|
Scheduler.Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -84,7 +83,10 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
|
|
||||||
tcs.Task.WaitSafely();
|
// Generally a timeout would not happen here as APIAccess will timeout first.
|
||||||
|
if (!tcs.Task.Wait(60000))
|
||||||
|
handleTokenFailure(new InvalidOperationException("Token retrieval timed out (request never run)"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
void handleTokenFailure(Exception exception)
|
void handleTokenFailure(Exception exception)
|
||||||
|
Loading…
Reference in New Issue
Block a user