Skip to content

CSHARP-4455: Fix test assertation. #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,17 @@ void AssertException(Exception ex)
// AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must not be configured
case "aws":
{
AssertInnerEncryptionException<AmazonServiceException>(ex, "Unable to get IAM security credentials from EC2 Instance Metadata Service.");
try
{
AssertInnerEncryptionException<AmazonServiceException>(ex, "Unable to get IAM security credentials from EC2 Instance Metadata Service.");
}
catch (XunitException)
{
// In rare cases, the thrown error is "CryptException exception: AcceessDeniedException". That means you don't have authorization to perform the requested action.
// It more or less corresponds to the expected behavior here, but it's unclear why the same scenario triggers different exceptions.
// However, it looks harmless to slightly update the test assertion to avoid assertion failures on EG.
AssertInnerEncryptionException<CryptException>(ex, "Error in KMS response. HTTP status=400. Response body=\n{\"__type\":\"AccessDeniedException\"}");
}
}
break;
case "azure":
Expand Down