1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:52:55 +08:00

Merge pull request #8932 from peppy/fix-play-song-select-test-intermittent-failure

Fix song select tests potentially failing due to difficulty panels not yet displayed
This commit is contained in:
Dan Balasescu 2020-05-04 15:20:19 +09:00 committed by GitHub
commit bcf7b160db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -110,7 +110,7 @@ namespace osu.Game.Tests.Visual.SongSelect
createSongSelect();
AddUntilStep("wait for initial selection", () => !Beatmap.IsDefault);
waitForInitialSelection();
WorkingBeatmap selected = null;
@ -135,7 +135,7 @@ namespace osu.Game.Tests.Visual.SongSelect
createSongSelect();
AddUntilStep("wait for initial selection", () => !Beatmap.IsDefault);
waitForInitialSelection();
WorkingBeatmap selected = null;
@ -189,7 +189,7 @@ namespace osu.Game.Tests.Visual.SongSelect
createSongSelect();
AddUntilStep("wait for initial selection", () => !Beatmap.IsDefault);
waitForInitialSelection();
WorkingBeatmap selected = null;
@ -769,6 +769,12 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("Check first item in group selected", () => Beatmap.Value.BeatmapInfo == groupIcon.Items.First().Beatmap);
}
private void waitForInitialSelection()
{
AddUntilStep("wait for initial selection", () => !Beatmap.IsDefault);
AddUntilStep("wait for difficulty panels visible", () => songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>().Any());
}
private int getBeatmapIndex(BeatmapSetInfo set, BeatmapInfo info) => set.Beatmaps.FindIndex(b => b == info);
private int getCurrentBeatmapIndex() => getBeatmapIndex(songSelect.Carousel.SelectedBeatmapSet, songSelect.Carousel.SelectedBeatmap);

View File

@ -140,7 +140,7 @@ namespace osu.Game.Beatmaps
{
var beatmapIds = beatmapSet.Beatmaps.Where(b => b.OnlineBeatmapID.HasValue).Select(b => b.OnlineBeatmapID).ToList();
LogForModel(beatmapSet, "Validating online IDs...");
LogForModel(beatmapSet, $"Validating online IDs for {beatmapSet.Beatmaps.Count} beatmaps...");
// ensure all IDs are unique
if (beatmapIds.GroupBy(b => b).Any(g => g.Count() > 1))