Skip to content

Commit 322f3ca

Browse files
surayya-MSbaronfel
authored andcommitted
fix test
1 parent 93aba7b commit 322f3ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Tests/Microsoft.NET.Build.Containers.UnitTests/RegistryTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ public async Task DownloadBlobAsync_RetriesOnFailure()
546546
var logger = _loggerFactory.CreateLogger(nameof(DownloadBlobAsync_RetriesOnFailure));
547547

548548
var repoName = "testRepo";
549-
var descriptor = new Descriptor("application/octet-stream", "sha256:testdigest", 1234);
549+
var descriptor = new Descriptor(SchemaTypes.OciLayerGzipV1, "sha256:testdigest1234", 1234);
550550
var cancellationToken = CancellationToken.None;
551551

552552
var mockRegistryAPI = new Mock<IRegistryAPI>(MockBehavior.Strict);
@@ -565,6 +565,9 @@ public async Task DownloadBlobAsync_RetriesOnFailure()
565565
Assert.NotNull(result);
566566
Assert.True(File.Exists(result)); // Ensure the file was successfully downloaded
567567
mockRegistryAPI.Verify(api => api.Blob.GetStreamAsync(repoName, descriptor.Digest, cancellationToken), Times.Exactly(3)); // Verify retries
568+
569+
//Cleanup
570+
File.Delete(result);
568571
}
569572

570573
private static NextChunkUploadInformation ChunkUploadSuccessful(Uri requestUri, Uri uploadUrl, int? contentLength, HttpStatusCode code = HttpStatusCode.Accepted)

0 commit comments

Comments
 (0)