Skip to content

Commit e0602db

Browse files
Skip online metadata fetch in BackgroundDataStoreProcessor during tests
This prevents flaky network requests and timeouts in unit tests that involve the BackgroundDataStoreProcessor (e.g. BackgroundDataStoreProcessorTests). The `backpopulateUserTags` task was attempting to download the full `online.db` database, causing significant delays and potential failures in CI environments. Skipping this operation when `DebugUtils.IsNUnitRunning` is true ensures tests run reliably and quickly without external dependencies. Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent b9f4221 commit e0602db

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

osu.Game/Database/BackgroundDataStoreProcessor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Newtonsoft.Json;
1111
using osu.Framework.Allocation;
1212
using osu.Framework.Bindables;
13+
using osu.Framework.Development;
1314
using osu.Framework.Extensions;
1415
using osu.Framework.Graphics;
1516
using osu.Framework.Logging;
@@ -636,6 +637,8 @@ private void backpopulateUserTags()
636637
{
637638
if (!localMetadataSource.Available || !localMetadataSource.IsAtLeastVersion(3))
638639
{
640+
if (DebugUtils.IsNUnitRunning) return;
641+
639642
Logger.Log(@"Local metadata cache has too low version to backpopulate user tags, attempting refetch...");
640643
localMetadataSource.FetchCache().WaitSafely();
641644

0 commit comments

Comments
 (0)