mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Merge pull request #22198 from frenzibyte/fix-mgcc-test-failure
Fix intermittent failure in GCC seeking test
This commit is contained in:
commit
d9045b5fa8
@ -73,16 +73,6 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
[FlakyTest]
|
|
||||||
/*
|
|
||||||
* Fail rate around 0.15%
|
|
||||||
*
|
|
||||||
* TearDown : osu.Framework.Testing.Drawables.Steps.AssertButton+TracedException : gameplay clock time = 2500
|
|
||||||
* --TearDown
|
|
||||||
* at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
|
|
||||||
* at osu.Framework.Threading.Scheduler.Update()
|
|
||||||
* at osu.Framework.Graphics.Drawable.UpdateSubTree()
|
|
||||||
*/
|
|
||||||
public void TestSeekPerformsInGameplayTime(
|
public void TestSeekPerformsInGameplayTime(
|
||||||
[Values(1.0, 0.5, 2.0)] double clockRate,
|
[Values(1.0, 0.5, 2.0)] double clockRate,
|
||||||
[Values(0.0, 200.0, -200.0)] double userOffset,
|
[Values(0.0, 200.0, -200.0)] double userOffset,
|
||||||
@ -92,6 +82,9 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
ClockBackedTestWorkingBeatmap working = null;
|
ClockBackedTestWorkingBeatmap working = null;
|
||||||
GameplayClockContainer gameplayClockContainer = null;
|
GameplayClockContainer gameplayClockContainer = null;
|
||||||
|
|
||||||
|
// ReSharper disable once NotAccessedVariable
|
||||||
|
BindableDouble trackAdjustment = null; // keeping a reference for track adjustment
|
||||||
|
|
||||||
if (setAudioOffsetBeforeConstruction)
|
if (setAudioOffsetBeforeConstruction)
|
||||||
AddStep($"preset audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
AddStep($"preset audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
||||||
|
|
||||||
@ -103,16 +96,16 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
gameplayClockContainer.Reset(startClock: !whileStopped);
|
gameplayClockContainer.Reset(startClock: !whileStopped);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(clockRate)));
|
AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, trackAdjustment = new BindableDouble(clockRate)));
|
||||||
|
|
||||||
if (!setAudioOffsetBeforeConstruction)
|
if (!setAudioOffsetBeforeConstruction)
|
||||||
AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
||||||
|
|
||||||
AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500));
|
AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500));
|
||||||
AddStep("gameplay clock time = 2500", () => Assert.AreEqual(gameplayClockContainer.CurrentTime, 2500, 10f));
|
AddAssert("gameplay clock time = 2500", () => gameplayClockContainer.CurrentTime, () => Is.EqualTo(2500).Within(10f));
|
||||||
|
|
||||||
AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000));
|
AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000));
|
||||||
AddStep("gameplay clock time = 10000", () => Assert.AreEqual(gameplayClockContainer.CurrentTime, 10000, 10f));
|
AddAssert("gameplay clock time = 10000", () => gameplayClockContainer.CurrentTime, () => Is.EqualTo(10000).Within(10f));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Loading…
Reference in New Issue
Block a user