Skip to content

Commit 12a86ca

Browse files
authored
Log more information for canceled CertificationOperations (Azure#18289)
Relates to Azure#17718
1 parent edc83b1 commit 12a86ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificateClientLiveTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ public async Task VerifyCancelCertificateOperation()
101101
Assert.Inconclusive("The create operation completed before it could be canceled.");
102102
}
103103

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

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

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

136140
Assert.IsTrue(operation.HasCompleted);

0 commit comments

Comments
 (0)