1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +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
commit 8b8f7953ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -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;