Skip to content

Commit

Permalink
[Storage][DataMovenet] Minor fixes to pause/resume tests (#40004)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalauzon-msft authored Nov 15, 2023
1 parent d0a909c commit 315e26a
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,13 @@ public async Task PauseThenResumeTransferAsync_Directory(TransferDirection trans
// Assert - Confirm we've paused
Assert.AreEqual(DataTransferState.Paused, transfer.TransferStatus.State);
await testEventsRaised.AssertPausedCheck();
int completedBeforePause = testEventsRaised.SingleCompletedEvents.Count;

// Act - Resume Job
DataTransferOptions resumeOptions = new DataTransferOptions();
DataTransferOptions resumeOptions = new()
{
CreationPreference = StorageResourceCreationPreference.OverwriteIfExists
};
TestEventsRaised testEventRaised2 = new TestEventsRaised(resumeOptions);
DataTransfer resumeTransfer = await transferManager.ResumeTransferAsync(
transferId: transfer.Id,
Expand All @@ -1005,7 +1009,7 @@ public async Task PauseThenResumeTransferAsync_Directory(TransferDirection trans
await resumeTransfer.WaitForCompletionAsync(waitTransferCompletion.Token);

// Assert
await testEventRaised2.AssertContainerCompletedCheck(partCount);
await testEventRaised2.AssertContainerCompletedCheck(partCount - completedBeforePause);
Assert.AreEqual(DataTransferState.Completed, resumeTransfer.TransferStatus.State);
Assert.IsTrue(resumeTransfer.HasCompleted);

Expand Down Expand Up @@ -1072,9 +1076,13 @@ public async Task ResumeTransferAsync_Directory(TransferDirection transferType)
// Assert - Confirm we've paused
Assert.AreEqual(DataTransferState.Paused, transfer.TransferStatus.State);
await testEventsRaised.AssertPausedCheck();
int completedBeforePause = testEventsRaised.SingleCompletedEvents.Count;

// Act - Resume Job
DataTransferOptions resumeOptions = new();
DataTransferOptions resumeOptions = new()
{
CreationPreference = StorageResourceCreationPreference.OverwriteIfExists
};
TestEventsRaised testEventsRaised2 = new TestEventsRaised(resumeOptions);
DataTransfer resumeTransfer = await transferManager.ResumeTransferAsync(
transfer.Id,
Expand All @@ -1084,7 +1092,7 @@ public async Task ResumeTransferAsync_Directory(TransferDirection transferType)
await resumeTransfer.WaitForCompletionAsync(waitTransferCompletion.Token);

// Assert
await testEventsRaised2.AssertContainerCompletedCheck(partCount);
await testEventsRaised2.AssertContainerCompletedCheck(partCount - completedBeforePause);
Assert.AreEqual(DataTransferState.Completed, resumeTransfer.TransferStatus.State);
Assert.IsTrue(resumeTransfer.HasCompleted);

Expand Down

0 comments on commit 315e26a

Please sign in to comment.