-
Notifications
You must be signed in to change notification settings - Fork 0
fix: psycopg instrumentation fixes #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
c8b7bad
fix cursor-stream
sohankshirsagar 1bdc5ca
refactor psycopg instrumentations to use mock utils
sohankshirsagar 132b556
instrument ServerCursor
sohankshirsagar 6e568a1
add psycopg cursor.copy() instrumentation for COPY operations
sohankshirsagar 8feb8a7
fix multiple queries on same cursor
sohankshirsagar 8723755
fix psycopg pipeline mode: defer result capture until sync()
sohankshirsagar da7329d
fix cursor iteration
sohankshirsagar 8421029
fix executemany with returning=True instrumentation for psycopg
sohankshirsagar 9c4a03e
fix cursor.scroll() support in psycopg replay mode
sohankshirsagar 3f801cf
fix cursor.rownumber property returning null during REPLAY mode
sohankshirsagar b7c8502
fix psycopg cursor.statusmessage capture and replay
sohankshirsagar 15a32a8
fix nextset() iteration for executemany with returning=True
sohankshirsagar 02a5b45
fix cursor.scroll() position tracking in RECORD mode
sohankshirsagar acbb31b
refactor
sohankshirsagar 35b3765
resolve cursor reuse hang in RECORD mode
sohankshirsagar d22ed0a
Fix UUID parameter serialization mismatch in psycopg REPLAY mode
sohankshirsagar 765fd9b
fix bytea serialization to preserve binary data during record/replay
sohankshirsagar c95337f
Fix kwargs_row row factory handling in psycopg instrumentation
sohankshirsagar 9a407ab
check number of tests replayed in e2e tests
sohankshirsagar be8de29
Fix scalar_row factory handling in psycopg instrumentation
sohankshirsagar 0a2a1c9
handle replaying uuid properly
sohankshirsagar f6d4d32
Fix binary format hang by deferring result capture until fetch
sohankshirsagar 8ad42ac
Enable null-values test for psycopg instrumentation
sohankshirsagar 0526956
Clean up null-values test comments
sohankshirsagar 2449d40
Enable transaction context manager test for psycopg instrumentation
sohankshirsagar a9ab04f
Clean up transaction context manager test comments
sohankshirsagar 7dbf9eb
fix logging OOM issue during e2e tests
sohankshirsagar 5fc28b2
Fix cursor.set_result() not mocked in REPLAY mode for executemany wit…
sohankshirsagar 6903b87
Refactor psycopg instrumentation to reduce code duplication
sohankshirsagar f04b88b
Fix Decimal and timedelta serialization for consistent RECORD/REPLAY …
sohankshirsagar 0170747
Refactor psycopg instrumentation: extract common helper methods
sohankshirsagar 66453ad
Fix inet/cidr network type serialization for REPLAY mode
sohankshirsagar 3418673
Fix psycopg Range type serialization for REPLAY mode
sohankshirsagar 08f5ce7
fix format + lint issues
sohankshirsagar e5101ed
fix type errors
sohankshirsagar 70e04b7
format
sohankshirsagar 26f92f7
try catch record mode
sohankshirsagar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| """Common utilities for Python SDK e2e tests.""" | ||
|
|
||
| from .base_runner import Colors, E2ETestRunnerBase | ||
| from .test_utils import get_request_count, make_request, print_request_summary | ||
|
|
||
| __all__ = ["Colors", "E2ETestRunnerBase"] | ||
| __all__ = [ | ||
| "Colors", | ||
| "E2ETestRunnerBase", | ||
| "get_request_count", | ||
| "make_request", | ||
| "print_request_summary", | ||
| ] |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| """ | ||
| Shared test utilities for e2e tests. | ||
|
|
||
| This module provides common functions used across all instrumentation e2e tests, | ||
| including request counting for validation. | ||
| """ | ||
|
|
||
| import time | ||
|
|
||
| import requests | ||
|
|
||
| BASE_URL = "http://localhost:8000" | ||
| _request_count = 0 | ||
|
|
||
|
|
||
| def make_request(method, endpoint, **kwargs): | ||
| """Make HTTP request, log result, and track count.""" | ||
| global _request_count | ||
| _request_count += 1 | ||
|
|
||
| url = f"{BASE_URL}{endpoint}" | ||
| print(f"→ {method} {endpoint}") | ||
| kwargs.setdefault("timeout", 30) | ||
| response = requests.request(method, url, **kwargs) | ||
| print(f" Status: {response.status_code}") | ||
| time.sleep(0.5) | ||
| return response | ||
|
|
||
|
|
||
| def get_request_count(): | ||
| """Return the current request count.""" | ||
| return _request_count | ||
|
|
||
|
|
||
| def print_request_summary(): | ||
| """Print the total request count in a parseable format.""" | ||
| print(f"\nTOTAL_REQUESTS_SENT:{_request_count}") |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.