@@ -329,6 +329,79 @@ await DownloadBlobDirectoryAndVerify(
329329 destinationFolder ) . ConfigureAwait ( false ) ;
330330 }
331331
332+ [ Test ]
333+ [ LiveOnly ] // https://github.com/Azure/azure-sdk-for-net/issues/33082
334+ public async Task DownloadDirectoryAsync_SmallChunks_ManyFiles ( )
335+ {
336+ // Arrange
337+ int blobSize = 2 * Constants . KB ;
338+ await using DisposingBlobContainer test = await GetTestContainerAsync ( ) ;
339+
340+ using DisposingLocalDirectory testDirectory = DisposingLocalDirectory . GetTestDirectory ( ) ;
341+ string tempFolder = CreateRandomDirectory ( testDirectory . DirectoryPath ) ;
342+ string blobDirectoryName = "foo" ;
343+ string fullSourceFolderPath = CreateRandomDirectory ( tempFolder , blobDirectoryName ) ;
344+
345+ List < string > blobNames = new List < string > ( ) ;
346+ string blobName = Path . Combine ( blobDirectoryName , GetNewBlobName ( ) ) ;
347+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
348+ blobNames . Add ( blobName ) ;
349+ blobName = Path . Combine ( blobDirectoryName , GetNewBlobName ( ) ) ;
350+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
351+ blobNames . Add ( blobName ) ;
352+ blobName = Path . Combine ( blobDirectoryName , GetNewBlobName ( ) ) ;
353+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
354+ blobNames . Add ( blobName ) ;
355+ blobName = Path . Combine ( blobDirectoryName , GetNewBlobName ( ) ) ;
356+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
357+ blobNames . Add ( blobName ) ;
358+ blobName = Path . Combine ( blobDirectoryName , GetNewBlobName ( ) ) ;
359+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
360+ blobNames . Add ( blobName ) ;
361+
362+ string subDir1 = CreateRandomDirectory ( fullSourceFolderPath , "bar" ) . Substring ( fullSourceFolderPath . Length + 1 ) ;
363+ blobName = Path . Combine ( blobDirectoryName , subDir1 , GetNewBlobName ( ) ) ;
364+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
365+ blobNames . Add ( blobName ) ;
366+ blobName = Path . Combine ( blobDirectoryName , subDir1 , GetNewBlobName ( ) ) ;
367+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
368+ blobNames . Add ( blobName ) ;
369+ blobName = Path . Combine ( blobDirectoryName , subDir1 , GetNewBlobName ( ) ) ;
370+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
371+ blobNames . Add ( blobName ) ;
372+ string subDir2 = CreateRandomDirectory ( fullSourceFolderPath , "rul" ) . Substring ( fullSourceFolderPath . Length + 1 ) ;
373+ blobName = Path . Combine ( blobDirectoryName , subDir2 , GetNewBlobName ( ) ) ;
374+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
375+ blobNames . Add ( blobName ) ;
376+ blobName = Path . Combine ( blobDirectoryName , subDir2 , GetNewBlobName ( ) ) ;
377+ await CreateBlockBlobAndSourceFile ( test . Container , tempFolder , blobName , blobSize ) ;
378+ blobNames . Add ( blobName ) ;
379+
380+ using DisposingLocalDirectory destinationFolder = DisposingLocalDirectory . GetTestDirectory ( ) ;
381+ string sourceBlobPrefix = fullSourceFolderPath . Substring ( tempFolder . Length + 1 ) ;
382+
383+ TransferManagerOptions transferManagerOptions = new TransferManagerOptions ( )
384+ {
385+ ErrorHandling = ErrorHandlingOptions . StopOnAllFailures ,
386+ MaximumConcurrency = 3
387+ } ;
388+ TransferOptions options = new TransferOptions ( )
389+ {
390+ InitialTransferSize = 512 ,
391+ MaximumTransferChunkSize = 512
392+ } ;
393+
394+ // Act / Assert
395+ await DownloadBlobDirectoryAndVerify (
396+ sourceContainer : test . Container ,
397+ sourceBlobPrefix : sourceBlobPrefix ,
398+ sourceFilePrefix : fullSourceFolderPath ,
399+ blobNames ,
400+ destinationFolder . DirectoryPath ,
401+ transferManagerOptions : transferManagerOptions ,
402+ options : options ) . ConfigureAwait ( false ) ;
403+ }
404+
332405 [ Test ]
333406 [ LiveOnly ] // https://github.com/Azure/azure-sdk-for-net/issues/33082
334407 public async Task DownloadDirectoryAsync_Root ( )
@@ -436,7 +509,7 @@ public async Task StartTransfer_AwaitCompletion()
436509 options : options ) ;
437510
438511 // Act
439- CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 5 ) ) ;
512+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
440513 await transfer . AwaitCompletion ( cancellationTokenSource . Token ) . ConfigureAwait ( false ) ;
441514
442515 // Assert
@@ -446,7 +519,6 @@ public async Task StartTransfer_AwaitCompletion()
446519 testEventsRaised . AssertContainerCompletedCheck ( 4 ) ;
447520 }
448521
449- //[Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35209")]
450522 [ Test ]
451523 [ LiveOnly ] // https://github.com/Azure/azure-sdk-for-net/issues/33082
452524 public async Task StartTransfer_AwaitCompletion_Failed ( )
@@ -473,7 +545,7 @@ public async Task StartTransfer_AwaitCompletion_Failed()
473545 options : options ) ;
474546
475547 // Act
476- CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 5 ) ) ;
548+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
477549 await transfer . AwaitCompletion ( cancellationTokenSource . Token ) . ConfigureAwait ( false ) ;
478550
479551 // Assert
@@ -484,7 +556,6 @@ public async Task StartTransfer_AwaitCompletion_Failed()
484556 testEventsRaised . AssertContainerCompletedWithFailedCheck ( 1 ) ;
485557 }
486558
487- //[Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35209")]
488559 [ Test ]
489560 [ LiveOnly ] // https://github.com/Azure/azure-sdk-for-net/issues/33082
490561 public async Task StartTransfer_AwaitCompletion_Skipped ( )
@@ -512,7 +583,7 @@ public async Task StartTransfer_AwaitCompletion_Skipped()
512583 options : options ) ;
513584
514585 // Act
515- CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 5 ) ) ;
586+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
516587 await transfer . AwaitCompletion ( cancellationTokenSource . Token ) . ConfigureAwait ( false ) ;
517588
518589 // Assert
@@ -542,7 +613,7 @@ public async Task StartTransfer_EnsureCompleted()
542613 options : options ) ;
543614
544615 // Act
545- CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 5 ) ) ;
616+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
546617 transfer . EnsureCompleted ( cancellationTokenSource . Token ) ;
547618
548619 // Assert
@@ -552,7 +623,6 @@ public async Task StartTransfer_EnsureCompleted()
552623 testEventsRaised . AssertContainerCompletedCheck ( 4 ) ;
553624 }
554625
555- //[Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35209")]
556626 [ Test ]
557627 [ LiveOnly ] // https://github.com/Azure/azure-sdk-for-net/issues/33082
558628 public async Task StartTransfer_EnsureCompleted_Failed ( )
@@ -579,7 +649,7 @@ public async Task StartTransfer_EnsureCompleted_Failed()
579649 options : options ) ;
580650
581651 // Act
582- CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 5 ) ) ;
652+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
583653 transfer . EnsureCompleted ( cancellationTokenSource . Token ) ;
584654
585655 // Assert
@@ -590,7 +660,6 @@ public async Task StartTransfer_EnsureCompleted_Failed()
590660 testEventsRaised . AssertContainerCompletedWithFailedCheck ( 1 ) ;
591661 }
592662
593- //[Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35209")]
594663 [ Test ]
595664 [ LiveOnly ] // https://github.com/Azure/azure-sdk-for-net/issues/33082
596665 public async Task StartTransfer_EnsureCompleted_Skipped ( )
@@ -618,7 +687,7 @@ public async Task StartTransfer_EnsureCompleted_Skipped()
618687 options : options ) ;
619688
620689 // Act
621- CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 5 ) ) ;
690+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
622691 transfer . EnsureCompleted ( cancellationTokenSource . Token ) ;
623692
624693 // Assert
0 commit comments