1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 06:39:54 +08:00

Merge pull request #26357 from bdach/score-submission-intermittent-fail

Fix player submission test intermittent failures due to audio playback discrepancy logic kicking in
This commit is contained in:
Dean Herbert
2024-01-03 20:50:54 +09:00
committed by GitHub
Unverified
2 changed files with 15 additions and 0 deletions
@@ -21,6 +21,7 @@ using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
using osu.Game.Tests.Beatmaps;
@@ -359,6 +360,11 @@ namespace osu.Game.Tests.Visual.Gameplay
AllowImportCompletion = new SemaphoreSlim(1);
}
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart)
{
ShouldValidatePlaybackRate = false,
};
protected override async Task ImportScore(Score score)
{
ScoreImportStarted = true;
@@ -40,6 +40,12 @@ namespace osu.Game.Screens.Play
Precision = 0.1,
};
/// <summary>
/// Whether the audio playback rate should be validated.
/// Mostly disabled for tests.
/// </summary>
internal bool ShouldValidatePlaybackRate { get; init; } = true;
/// <summary>
/// Whether the audio playback is within acceptable ranges.
/// Will become false if audio playback is not going as expected.
@@ -223,6 +229,9 @@ namespace osu.Game.Screens.Play
private void checkPlaybackValidity()
{
if (!ShouldValidatePlaybackRate)
return;
if (GameplayClock.IsRunning)
{
elapsedGameplayClockTime += GameplayClock.ElapsedFrameTime;