Fix flaky editor beatmap creation test

Came up as a failure when locally running tests for
ppy/osu-framework#6001 - but the test is actually a previously-known
flaky that I couldn't reproduce the failure of until the aforementioned
PR.

This appears to be a simple race; the test scene queries the track
length from update thread, but the length is actually set on the audio
thread. So it's not unreasonable that given unlucky timing, the length
will not be set by `TrackBass` before it is queried.

To fix, switch assert to until step. I'm generally not really willing
to give this more time of day until this change is proven insufficient.
This commit is contained in:
Bartłomiej Dach 2023-09-26 16:40:18 +02:00
parent 40a548d372
commit 12585c9f27
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ public void TestAddAudioTrack()
});
AddAssert("track is not virtual", () => Beatmap.Value.Track is not TrackVirtual);
AddAssert("track length changed", () => Beatmap.Value.Track.Length > 60000);
AddUntilStep("track length changed", () => Beatmap.Value.Track.Length > 60000);
AddStep("test play", () => Editor.TestGameplay());