From 5860e1e8dd99491d1d724c32920ce16517c992e2 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Fri, 4 Dec 2020 14:42:25 -0800 Subject: [PATCH] bump network timeout, add progress logging. --- sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs | 2 +- .../Azure.Storage.Blobs/tests/BlockBlobClientTests.cs | 7 ++++++- .../Azure.Storage.Files.DataLake/tests/DataLakeTestBase.cs | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs index abc7375d1d289..01aff483c464b 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs @@ -75,7 +75,7 @@ public BlobClientOptions GetOptions(bool parallelRange = false) MaxRetries = Storage.Constants.MaxReliabilityRetries, Delay = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 0.01 : 1), MaxDelay = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 0.1 : 60), - NetworkTimeout = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 100 : 200), + NetworkTimeout = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 100 : 400), }, Transport = GetTransport() }; diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlockBlobClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlockBlobClientTests.cs index 6a786a8ce99da..813f051b41908 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlockBlobClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlockBlobClientTests.cs @@ -2107,9 +2107,14 @@ public async Task UploadAsync_SingleUpload_DefaultThreshold() long blobSize = Constants.Blob.Block.Pre_2019_12_12_MaxUploadBytes - 1; var data = GetRandomBuffer(blobSize); using Stream stream = new MemoryStream(data); + var dateTimeFormat = "yyyy-MM-ddTHH:mm:ss.fff"; + var progressHandler = new Progress(n => + { + TestContext.Out.WriteLine($"{DateTime.Now.ToString(dateTimeFormat)} sent {n} bytes"); + }); // Act - await blob.UploadAsync(content: stream); + await blob.UploadAsync(content: stream, progressHandler: progressHandler); // Assert Response blockListResponse = await blob.GetBlockListAsync(); diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeTestBase.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeTestBase.cs index 52affe267b504..506f04db3f632 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeTestBase.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeTestBase.cs @@ -70,7 +70,7 @@ public DataLakeClientOptions GetOptions(bool parallelRange = false) MaxRetries = Constants.MaxReliabilityRetries, Delay = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 0.01 : 1), MaxDelay = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 0.1 : 60), - NetworkTimeout = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 100 : 200), + NetworkTimeout = TimeSpan.FromSeconds(Mode == RecordedTestMode.Playback ? 100 : 400), }, Transport = GetTransport() };