Skip to content
Unverified Commit 2c0274cb authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Compare query strings based on set of components in ec2 integration tests (#3859)

## Motivation and Context
Avoids comparing raw strings in ec2 integration tests

## Description
With a updated service model for ec2, we have run into the following
test failures in its integration tests,
```
----- paginators_handle_unset_tokens stdout ----
body did not match. left=expected, right=actual
Diff < left / right > :
<Action=DescribeSpotPriceHistory&Version=2016-11-15&·[1;48;5;52;31mAvailabilityZone=eu-north-1a&InstanceType.1=g5.48xlarge&ProductDescription.1=Linux%2FUNIX
>Action=DescribeSpotPriceHistory&Version=2016-11-15&InstanceType.1=g5.48xlarge&ProductDescription.1=Linux%2FUNIX·[1;48;5;22;32m&AvailabilityZone=eu-north-1a
 
thread 'paginators_handle_unset_tokens' panicked at sdk/aws-smithy-runtime/src/client/http/test_util/replay.rs:98:43:

---- paginators_handle_empty_tokens stdout ----
body did not match. left=expected, right=actual
Diff < left / right > :
<Action=DescribeSpotPriceHistory&Version=2016-11-15&·[1;48;5;52;31mAvailabilityZone=eu-north-1a&InstanceType.1=g5.48xlarge&ProductDescription.1=Linux%2FUNIX
>Action=DescribeSpotPriceHistory&Version=2016-11-15&InstanceType.1=g5.48xlarge&ProductDescription.1=Linux%2FUNIX·[1;48;5;22;32m&AvailabilityZone=eu-north-1a

thread 'paginators_handle_empty_tokens' panicked at sdk/aws-smithy-runtime/src/client/http/test_util/replay.rs:98:43:
```

We don't know exactly how a generated ec2 SDK built up query strings in
a different order from what it is today, but whatever the root cause is,
the ultimate fix remains the same. Comparing raw query strings can be
unreliable, so this PR will fix that by comparing sets of strings
derived from query strings.

## Testing
Ran the edited tests against the generated ec2 SDK in question and it
passed (without this PR, it did fail).

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 4d0b838a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment