Summary
PackageCacheServiceTests.GetCacheInfo_EmptyCache_ReturnsZeroStats can fail in
the Ubuntu CI lane because another parallel test changes and populates the
process-global cache after this test initializes its unique empty cache.
Observed on PR #3810:
Assert.Empty() Failure: Collection was not empty
Collection: [CacheCategoryInfo { Name = pkg-index-v12, Size = 568, Count = 6 }]
at PackageCacheServiceTests.GetCacheInfo_EmptyCache_ReturnsZeroStats()
Evidence
The test calls:
NuGetCache.Initialize("dotnet-inspect-cache-test-empty-" + Guid.NewGuid().ToString("N")[..8]);
var info = PackageCacheService.GetCacheInfo();
but PackageCacheServiceTests is not in CoreCacheCollection. Several other
DotnetInspector.Services.Tests classes that initialize or use CoreCache are
also outside that collection. The xUnit runner executes collections in
parallel, so the unique cache name is not sufficient isolation when another
test can reinitialize the shared static cache between Initialize and
GetCacheInfo.
The failing pkg-index-v12 category belongs to PackageIndexCache, not to the
RTS/product-surface changes in #3810. The same PR head passed the focused local
product, C# shell, RoundTrip, skeleton, authored-corpus, and parity gates.
Expected
Tests that mutate process-global cache initialization should be serialized or
use an instance-scoped test seam so an empty-cache assertion cannot observe
another test's cache.
Summary
PackageCacheServiceTests.GetCacheInfo_EmptyCache_ReturnsZeroStatscan fail inthe Ubuntu CI lane because another parallel test changes and populates the
process-global cache after this test initializes its unique empty cache.
Observed on PR #3810:
Evidence
The test calls:
but
PackageCacheServiceTestsis not inCoreCacheCollection. Several otherDotnetInspector.Services.Testsclasses that initialize or useCoreCachearealso outside that collection. The xUnit runner executes collections in
parallel, so the unique cache name is not sufficient isolation when another
test can reinitialize the shared static cache between
InitializeandGetCacheInfo.The failing
pkg-index-v12category belongs toPackageIndexCache, not to theRTS/product-surface changes in #3810. The same PR head passed the focused local
product, C# shell, RoundTrip, skeleton, authored-corpus, and parity gates.
Expected
Tests that mutate process-global cache initialization should be serialized or
use an instance-scoped test seam so an empty-cache assertion cannot observe
another test's cache.