1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-22 13:45:08 +08:00

Fix test not waiting properly for background processing to complete

This commit is contained in:
Bartłomiej Dach 2024-07-16 14:01:33 +02:00
parent 6db135279f
commit 53b6f9e385
No known key found for this signature in database

View File

@ -179,7 +179,9 @@ namespace osu.Game.Tests.Database
}); });
}); });
AddStep("Run background processor", () => Add(new TestBackgroundDataStoreProcessor())); TestBackgroundDataStoreProcessor processor = null!;
AddStep("Run background processor", () => Add(processor = new TestBackgroundDataStoreProcessor()));
AddUntilStep("Wait for completion", () => processor.Completed);
AddUntilStep("Score marked as failed", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.True); AddUntilStep("Score marked as failed", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.True);
AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(scoreVersion)); AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(scoreVersion));