1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 20:53:00 +08:00

Merge pull request #18853 from peppy/fix-flaky-playlist-test

Attempt to fix flaky `PlaylistOverlay` test
This commit is contained in:
Dan Balasescu 2022-06-27 13:48:19 +09:00 committed by GitHub
commit 1c1016d0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,8 @@ namespace osu.Game.Tests.Visual.UserInterface
private Live<BeatmapSetInfo> first; private Live<BeatmapSetInfo> first;
private const int item_count = 100;
[SetUp] [SetUp]
public void Setup() => Schedule(() => public void Setup() => Schedule(() =>
{ {
@ -46,7 +48,7 @@ namespace osu.Game.Tests.Visual.UserInterface
beatmapSets.Clear(); beatmapSets.Clear();
for (int i = 0; i < 100; i++) for (int i = 0; i < item_count; i++)
{ {
beatmapSets.Add(TestResources.CreateTestBeatmapSetInfo().ToLiveUnmanaged()); beatmapSets.Add(TestResources.CreateTestBeatmapSetInfo().ToLiveUnmanaged());
} }
@ -59,6 +61,13 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test] [Test]
public void TestRearrangeItems() public void TestRearrangeItems()
{ {
AddUntilStep("wait for load complete", () =>
{
return this
.ChildrenOfType<PlaylistItem>()
.Count(i => i.ChildrenOfType<DelayedLoadWrapper>().First().DelayedLoadCompleted) > 6;
});
AddUntilStep("wait for animations to complete", () => !playlistOverlay.Transforms.Any()); AddUntilStep("wait for animations to complete", () => !playlistOverlay.Transforms.Any());
AddStep("hold 1st item handle", () => AddStep("hold 1st item handle", () =>