mirror of
https://github.com/ppy/osu.git
synced 2025-02-03 01:22:58 +08:00
Merge pull request #28884 from smoogipoo/bds-test
Fix BackgroundDataStoreProcessor test failure
This commit is contained in:
commit
5633297d1c
@ -157,8 +157,9 @@ namespace osu.Game.Tests.Database
|
|||||||
AddAssert("Score not marked as failed", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.False);
|
AddAssert("Score not marked as failed", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase(30000002)]
|
||||||
public void TestScoreUpgradeFailed()
|
[TestCase(30000013)]
|
||||||
|
public void TestScoreUpgradeFailed(int scoreVersion)
|
||||||
{
|
{
|
||||||
ScoreInfo scoreInfo = null!;
|
ScoreInfo scoreInfo = null!;
|
||||||
|
|
||||||
@ -172,16 +173,18 @@ namespace osu.Game.Tests.Database
|
|||||||
Ruleset = r.All<RulesetInfo>().First(),
|
Ruleset = r.All<RulesetInfo>().First(),
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
TotalScoreVersion = 30000002,
|
TotalScoreVersion = scoreVersion,
|
||||||
IsLegacyScore = true,
|
IsLegacyScore = true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
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(30000002));
|
AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(scoreVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -389,7 +389,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
HashSet<Guid> scoreIds = realmAccess.Run(r => new HashSet<Guid>(
|
HashSet<Guid> scoreIds = realmAccess.Run(r => new HashSet<Guid>(
|
||||||
r.All<ScoreInfo>()
|
r.All<ScoreInfo>()
|
||||||
.Where(s => s.TotalScoreVersion < 30000013) // last total score version with a significant change to ranks
|
.Where(s => s.TotalScoreVersion < 30000013 && !s.BackgroundReprocessingFailed) // last total score version with a significant change to ranks
|
||||||
.AsEnumerable()
|
.AsEnumerable()
|
||||||
// must be done after materialisation, as realm doesn't support
|
// must be done after materialisation, as realm doesn't support
|
||||||
// filtering on nested property predicates or projection via `.Select()`
|
// filtering on nested property predicates or projection via `.Select()`
|
||||||
|
Loading…
Reference in New Issue
Block a user