Make backwards compatible with urllib3~=1.0 [Follow up #197] #206
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.
Description
Not sure how we missed this when testing #197, but
urllib3~=1.x
does not implementbackoff_max
orbackoff_jitter
configurations. So executions would fail for users who installedurllib31=1.x
. This PR completes the work of #197 and updates our retry test mocks to be compatible with the internal workings of the older urllib3 version.urllib3 version 1 expects the response to include a
.msg
attribute with.keys()
and.items()
methods. While in real-life execution this would be anHTTPMessage
object, thedict()
that our mocks use for headers is already sufficient and implements those methods..msg
is ignored in urllib3 version 2 so the same mock definition works regardless of which version of urllib3 is installed.Going forward, we should have some kind of smoke test that runs our tests with both versions of urllib3 installed. A bare install of this connector always pulls urllib3 version 2, but many customers and partners will have already installed an older urllib3 -- this case isn't captured in our current testing pattern.
Related Tickets & Documents
Resolves #205
Resolves ES-836977