Skip to content

Commit 715a469

Browse files
Fix TestSceneGameplayRewinding failure due to clock drift in CI
1 parent 046d0d9 commit 715a469

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

osu.Game.Tests/Visual/Gameplay/TestSceneGameplayRewinding.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public partial class TestSceneGameplayRewinding : OsuPlayerTestScene
2323
private AudioManager audioManager { get; set; }
2424

2525
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null) =>
26-
new ClockBackedTestWorkingBeatmap(beatmap, storyboard, new FramedClock(new ManualClock { Rate = 1 }), audioManager);
26+
new ClockBackedTestWorkingBeatmap(beatmap, storyboard, Clock, audioManager);
2727

2828
[Test]
2929
public void TestNoJudgementsOnRewind()
@@ -41,10 +41,15 @@ public void TestNoJudgementsOnRewind()
4141

4242
private void addSeekStep(double time)
4343
{
44-
AddStep($"seek to {time}", () => Beatmap.Value.Track.Seek(time));
44+
AddStep($"seek to {time}", () =>
45+
{
46+
Beatmap.Value.Track.Seek(time);
47+
});
4548

46-
// Allow a few frames of lenience
47-
AddUntilStep("wait for seek to finish", () => Precision.AlmostEquals(time, Player.DrawableRuleset.FrameStableClock.CurrentTime, 100));
49+
if (time > 1500)
50+
AddUntilStep("wait for seek to finish (>=)", () => Player.DrawableRuleset.FrameStableClock.CurrentTime >= time);
51+
else
52+
AddUntilStep("wait for seek to finish (<=)", () => Player.DrawableRuleset.FrameStableClock.CurrentTime <= time + 1000);
4853
}
4954

5055
protected override TestPlayer CreatePlayer(Ruleset ruleset)

0 commit comments

Comments
 (0)