PYTHON-5724 Add integration test exercising compression logic#2935
Draft
aclark4life wants to merge 1 commit into
Draft
PYTHON-5724 Add integration test exercising compression logic#2935aclark4life wants to merge 1 commit into
aclark4life wants to merge 1 commit into
Conversation
c499d8c to
d404c2f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new integration coverage to validate wire-protocol compression behavior by running real commands with each negotiated compressor, aiming to exercise the compress/decompress path used by the driver’s networking stack.
Changes:
- Import concrete compression context classes (Snappy/Zlib/Zstd) into the client test modules for type assertions.
- Add
test_compression_commands(sync + async) to negotiate each available compressor, assert the negotiated context type, and spy oncompress()during a CRUD round-trip.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/test_client.py | Adds a sync integration test that negotiates compressors and verifies compression is used during command execution. |
| test/asynchronous/test_client.py | Adds the async equivalent integration test for compressor negotiation and command execution. |
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.
PYTHON-5724
Changes in this PR
Adds an integration test that sends real commands with each available wire-protocol compressor enabled, exercising the end-to-end compress/decompress path in
compression_support.py.test_compression_commandsintest/asynchronous/test_client.py.Test Plan
For each available compressor, the test handshakes so the server negotiates it, then asserts the pooled connection received the correct compressor context type (skipped if the server did not negotiate it):
compressor_idsnappySnappyContextzlibZlibContextzstdZstdContextIt then spies on
compress()and round-trips an insert/find of compressible data, asserting both thatcompress()was invoked (send path) and that the decompressed response matches (receive path viadecompress).Checklist
Checklist for Author
compression_support.py.Checklist for Reviewer