test_s3: fix test_bucket_logging_request_id for newer botocore#751
Open
cheese-cakee wants to merge 1 commit into
Open
test_s3: fix test_bucket_logging_request_id for newer botocore#751cheese-cakee wants to merge 1 commit into
cheese-cakee wants to merge 1 commit into
Conversation
Contributor
Author
The test was using a boto3 event handler to capture the x-amz-request-id header, incorrectly accessing kwargs["response"] in an after-call event. Botocore's after-call event does not pass a "response" kwarg; it passes "parsed", "http_response", "model", and "context". Fix by reading the request ID directly from the put_object() response, which is simpler and works across all botocore versions. Fixes: https://tracker.ceph.com/issues/76587 Signed-off-by: cheese-cakee <farzanaman99@gmail.com>
bc994a5 to
edb8851
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
test_bucket_logging_request_id(introduced in #729) registersa boto3
after-call.s3.PutObjectevent handler that incorrectly accesseskwargs["response"]. Botocore does not pass aresponsekwarg inafter-callevents; the correct kwargs areparsed,http_response,model, andcontext.This causes the test to fail in teuthology with:
Fix by reading the
x-amz-request-idheader directly from theput_object()response, which is simpler and works across all botocoreversions.
Fixes: http://tracker.ceph.com/issues/76587
Related: #729