Skip to content

Commit

Permalink
Log more information for canceled CertificationOperations (#18289)
Browse files Browse the repository at this point in the history
Relates to #17718
  • Loading branch information
heaths authored Jan 29, 2021
1 parent edc83b1 commit 12a86ca
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 12a86ca

Please sign in to comment.