Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageVersion Include="CopyOnWrite" Version="0.5.0" />
<PackageVersion Include="DotNet.Glob" Version="2.0.3" />
<PackageVersion Include="ILRepack" Version="2.0.44" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.10" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="Microsoft.Build" Version="$(MSBuildPackageVersion)" />
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MSBuildPackageVersion)" />
Expand Down Expand Up @@ -43,12 +43,12 @@
<PackageVersion Include="protobuf-net.Grpc" Version="1.1.1" />
<PackageVersion Include="RocksDbNative" Version="8.1.1-20241011.2" />
<PackageVersion Include="RocksDbSharp" Version="8.1.1-20241011.2" />
<PackageVersion Include="System.Collections.Immutable" Version="9.0.0" />
<PackageVersion Include="System.Memory" Version="4.6.0" />
<PackageVersion Include="System.Collections.Immutable" Version="10.0.10" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.Private.ServiceModel" Version="4.10.3" />
<PackageVersion Include="System.Reflection.Metadata" Version="9.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
<PackageVersion Include="System.Text.Json" Version="10.0.10" />
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.0" />

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"rollForward": "latestFeature"
},
"msbuild-sdks": {
"MSTest.Sdk": "4.1.0"
"MSTest.Sdk": "4.4.0"
},
"test": {
"runner": "Microsoft.Testing.Platform"
Expand Down
15 changes: 7 additions & 8 deletions src/AzurePipelines.Tests/SelectorPublicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,14 @@ async Task<bool> TryPublishAsync(

Assert.IsTrue(await firstPublication);
Assert.IsTrue(await secondPublication);
CollectionAssert.AreEquivalent(
new[] { existingSelector, firstSelector, secondSelector },
finalWinner!.Selectors.ToArray());
Assert.AreSequenceEqual(
new[] { existingSelector, firstSelector, secondSelector }, finalWinner!.Selectors.ToArray(), SequenceOrder.InAnyOrder);
string initialWriteKey = PipelineCachingCacheClient.ComputeSelectorsWriteKey(Universe, weakFingerprint, initial.Id);
CollectionAssert.AreEqual(new[] { initialWriteKey }, conflictQueries.ToArray());
Assert.AreSequenceEqual(new[] { initialWriteKey }, conflictQueries.ToArray());
Assert.AreEqual(
PipelineCachingCacheClient.ComputeSelectorsWriteKey(Universe, weakFingerprint, firstWinner!.Id),
finalWriteKey);
StringAssert.StartsWith(latestKey, "selector6|", StringComparison.Ordinal);
Assert.StartsWith("selector6|", latestKey, StringComparison.Ordinal);
}

[TestMethod]
Expand All @@ -136,9 +135,9 @@ public void OutputKeyIncludesSelectorOutput()
string secondKey = PipelineCachingCacheClient.ComputeOutputKey("universe", second, forWrite: false, writeId: 0);

Assert.AreNotEqual(firstKey, secondKey);
StringAssert.StartsWith(firstKey, "outputs6|", StringComparison.Ordinal);
StringAssert.Contains(firstKey, "|01|", StringComparison.Ordinal);
StringAssert.Contains(secondKey, "|02|", StringComparison.Ordinal);
Assert.StartsWith("outputs6|", firstKey, StringComparison.Ordinal);
Assert.Contains("|01|", firstKey, StringComparison.Ordinal);
Assert.Contains("|02|", secondKey, StringComparison.Ordinal);
}

private static Selector CreateSelector(byte output)
Expand Down
8 changes: 4 additions & 4 deletions src/Common.Tests/CasCacheClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task AddNodeDoesNotUploadContentWhenRemoteCacheIsReadOnly()
Assert.AreEqual(0, remoteSession.PutFileCallCount, "Content must not be uploaded when the remote cache is read-only.");

// The node still needs to be written to the local cache.
Assert.IsTrue(localSession.PutStreamCallCount > 0, "The node metadata must still be written to the local cache.");
Assert.IsGreaterThan(0, localSession.PutStreamCallCount, "The node metadata must still be written to the local cache.");
Assert.AreEqual(1, localSession.AddOrGetContentHashListCallCount, "The content hash list must still be added to the local cache.");
}

Expand All @@ -71,9 +71,9 @@ public async Task AddNodeUploadsContentWhenRemoteCacheIsWritable()
await cacheClient.AddNodeInternalAsync(CreateNodeContext(), pathSet: null, CreateNodeBuildResult(), CancellationToken.None);
}

Assert.IsTrue(remoteSession.PinCallCount > 0, "The remote session should be pinned to determine what to upload.");
Assert.IsTrue(remoteSession.PutStreamCallCount > 0, "Content should be uploaded when the remote cache is writable.");
Assert.IsTrue(localSession.PutStreamCallCount > 0, "The node metadata should be written to the local cache.");
Assert.IsGreaterThan(0, remoteSession.PinCallCount, "The remote session should be pinned to determine what to upload.");
Assert.IsGreaterThan(0, remoteSession.PutStreamCallCount, "Content should be uploaded when the remote cache is writable.");
Assert.IsGreaterThan(0, localSession.PutStreamCallCount, "The node metadata should be written to the local cache.");
}

private static (CasCacheClient CacheClient, RecordingCacheSession LocalSession, RecordingCacheSession RemoteSession) CreateCacheClient(bool remoteCacheIsReadOnly)
Expand Down
Loading