mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08:00
Merge pull request #18914 from peppy/spectator-playback-test-leniences
Increase leniences on `TestSceneSpectatorPlayback.TestWithSendFailure`
This commit is contained in:
commit
8e4a6c43b5
@ -167,11 +167,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddStep("start failing sends", () =>
|
||||
{
|
||||
spectatorClient.ShouldFailSendingFrames = true;
|
||||
framesReceivedSoFar = replay.Frames.Count;
|
||||
frameSendAttemptsSoFar = spectatorClient.FrameSendAttempts;
|
||||
});
|
||||
|
||||
AddUntilStep("wait for send attempts", () => spectatorClient.FrameSendAttempts > frameSendAttemptsSoFar + 5);
|
||||
AddUntilStep("wait for next send attempt", () =>
|
||||
{
|
||||
framesReceivedSoFar = replay.Frames.Count;
|
||||
return spectatorClient.FrameSendAttempts > frameSendAttemptsSoFar + 1;
|
||||
});
|
||||
|
||||
AddUntilStep("wait for more send attempts", () => spectatorClient.FrameSendAttempts > frameSendAttemptsSoFar + 10);
|
||||
AddAssert("frames did not increase", () => framesReceivedSoFar == replay.Frames.Count);
|
||||
|
||||
AddStep("stop failing sends", () => spectatorClient.ShouldFailSendingFrames = false);
|
||||
|
@ -294,17 +294,21 @@ namespace osu.Game.Online.Spectator
|
||||
|
||||
lastSend = tcs.Task;
|
||||
|
||||
SendFramesInternal(bundle).ContinueWith(t => Schedule(() =>
|
||||
SendFramesInternal(bundle).ContinueWith(t =>
|
||||
{
|
||||
// Handle exception outside of `Schedule` to ensure it doesn't go unovserved.
|
||||
bool wasSuccessful = t.Exception == null;
|
||||
|
||||
// If the last bundle send wasn't successful, try again without dequeuing.
|
||||
if (wasSuccessful)
|
||||
pendingFrameBundles.Dequeue();
|
||||
return Schedule(() =>
|
||||
{
|
||||
// If the last bundle send wasn't successful, try again without dequeuing.
|
||||
if (wasSuccessful)
|
||||
pendingFrameBundles.Dequeue();
|
||||
|
||||
tcs.SetResult(wasSuccessful);
|
||||
sendNextBundleIfRequired();
|
||||
}));
|
||||
tcs.SetResult(wasSuccessful);
|
||||
sendNextBundleIfRequired();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user