Skip to content

Commit

Permalink
Log more information for canceled CertificationOperations
Browse files Browse the repository at this point in the history
Relates to Azure#17718
  • Loading branch information
heaths committed Jan 29, 2021
1 parent f1bfb3a commit 0021000
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ public async Task VerifyCancelCertificateOperation()
Assert.Inconclusive("The create operation completed before it could be canceled.");
}

OperationCanceledException ex = Assert.ThrowsAsync<OperationCanceledException>(() => WaitForCompletion(operation));
OperationCanceledException ex = Assert.ThrowsAsync<OperationCanceledException>(
() => WaitForCompletion(operation),
$"Expected exception {nameof(OperationCanceledException)} not thrown. Operation status: {operation?.Properties?.Status}, error: {operation?.Properties?.Error?.Message}");
Assert.AreEqual("The operation was canceled so no value is available.", ex.Message);

Assert.IsTrue(operation.HasCompleted);
Expand Down Expand Up @@ -130,7 +132,9 @@ public async Task VerifyUnexpectedCancelCertificateOperation()
Assert.Inconclusive("The create operation completed before it could be canceled.");
}

OperationCanceledException ex = Assert.ThrowsAsync<OperationCanceledException>(() => WaitForCompletion(operation));
OperationCanceledException ex = Assert.ThrowsAsync<OperationCanceledException>(
() => WaitForCompletion(operation),
$"Expected exception {nameof(OperationCanceledException)} not thrown. Operation status: {operation?.Properties?.Status}, error: {operation?.Properties?.Error?.Message}");
Assert.AreEqual("The operation was canceled so no value is available.", ex.Message);

Assert.IsTrue(operation.HasCompleted);
Expand Down

0 comments on commit 0021000

Please sign in to comment.