Skip to content

Commit

Permalink
Fix testCurrentOperationByteCount test race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Giardino committed Jan 14, 2013
1 parent a8b26d2 commit 4e49db0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -748,21 +748,21 @@ public void testCurrentOperationByteCount() throws URISyntaxException, StorageEx

OperationContext operationContext = new OperationContext();
BlobRequestOptions options = new BlobRequestOptions();
options.setTimeoutIntervalInMs(1000);
options.setTimeoutIntervalInMs(2000);
options.setRetryPolicyFactory(new RetryNoRetry());
ByteArrayOutputStream downloadedDataStream = new ByteArrayOutputStream();
try {
final ByteArrayOutputStream downloadedDataStream = new ByteArrayOutputStream();
blobRef.download(downloadedDataStream, null, options, operationContext);
}
catch (Exception e) {
Assert.assertEquals(0, operationContext.getCurrentOperationByteCount());
Assert.assertEquals(downloadedDataStream.size(), operationContext.getCurrentOperationByteCount());
}

operationContext = new OperationContext();
options = new BlobRequestOptions();
options.setTimeoutIntervalInMs(90000);

final ByteArrayOutputStream downloadedDataStream = new ByteArrayOutputStream();
downloadedDataStream = new ByteArrayOutputStream();
blobRef.download(downloadedDataStream, null, options, operationContext);

Assert.assertEquals(blockLength * numberOfBlocks, operationContext.getCurrentOperationByteCount());
Expand Down

0 comments on commit 4e49db0

Please sign in to comment.