Fix failing federated S3 tests (GSI-1148) #139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
test_federated_s3.test_populate_dummy_items
sporadically failed when running on GitHub.After spending several hours debugging, we finally found the root cause: Docker maps containers to random ports, which can be different for the IPv4 and IPv6 addresses of localhost. It can happen that the port assigned for IPv6 for one container overshadows the port assigned for IPv4 of the other container. In the federated S3 test, all S3 operations would then execute on that same container, which causes the tests to fail.
As a simple solution, this PR changes the
endpoint_url
fromlocalhost
to127.0.0.1
in order to make sure that only the IPv4 port is used when accessing the localstack container.The PR also cleans up the passing of parameters to the localstack container. The
name
parameter is not used and not passed any more. Also, the image used for the localstack test container has been updated from 3.5.0 to 3.8.1.Additionally, the PR also improves the
_does_object_exist
method so that it properly raises possible errors (this works similarly to_does_bucket_exist
now).