Skip to content

Commit

Permalink
[Storage] Bump network timeout, add progress logging. (#17350)
Browse files Browse the repository at this point in the history
- Bump network timeout to 400s to see if it's enough for worst case agent-network-storage account combo
- add progress logging to flaky tests to see if it hangs.
  • Loading branch information
kasobol-msft authored Dec 4, 2020
1 parent 16ac6c4 commit 294ccd1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<long>(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<BlockList> blockListResponse = await blob.GetBlockListAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down

0 comments on commit 294ccd1

Please sign in to comment.