FIX: Fixed bugs in existing test suite and added additional stress tests#523
Open
gargsaumya wants to merge 6 commits intomainfrom
Open
FIX: Fixed bugs in existing test suite and added additional stress tests#523gargsaumya wants to merge 6 commits intomainfrom
gargsaumya wants to merge 6 commits intomainfrom
Conversation
New tests: - test_executemany_large_batch_mixed_types: 10k rows, mixed types via executemany - test_null_heavy_large_result_set: 50k rows with 6/8 cols NULL, verify None propagation - test_cursor_reuse_high_iteration: single cursor reused 5000 times, memory leak check - test_fetchone_loop_vs_fetchall_parity: 100k row bit-identical comparison of both fetch paths - test_concurrent_read_write_no_corruption: 5 writers + 5 readers on shared table for 10s Bug fixes: - test_concurrent_fetch_data_integrity_no_corruption: verification block was inside thread.join() loop instead of after it (race condition + premature fail) - test_pool_exhaustion_recovery: pool max_size was silently overridden by run_parallel(); added pool_max_size param to MultiThreadedQueryRunner; fixed multi-statement query - test numbering: docstring sequence skipped #4 (renumbered #5-#7 -> #4-#6) Also registers 'slow' mark in pytest.ini to suppress PytestUnknownMarkWarning
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR expands the stress test suite with additional high-scale single-threaded and multi-threaded scenarios, and fixes a few correctness/config issues in existing tests.
Changes:
- Added multiple new single-threaded stress tests (executemany mixed types, NULL-heavy results, cursor reuse, fetch parity).
- Improved multi-threaded stress runner configurability via explicit
pool_max_size, and updated pool exhaustion test accordingly. - Added a new concurrent mixed read/write stress test and registered the
slowpytest marker.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tests/test_020_multithreaded_stress.py | Adds pool_max_size to the runner, adjusts pool exhaustion test, and introduces a new concurrent read/write stress test. |
| tests/test_011_singlethreaded_stress.py | Fixes a race in existing concurrent fetch verification and adds several new large-scale stress tests. |
| pytest.ini | Registers the slow marker to avoid unknown-mark warnings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 67.8%
mssql_python.row.py: 70.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 74.2%
mssql_python.pybind.connection.connection.cpp: 75.8%
mssql_python.__init__.py: 77.3%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.connection.py: 85.2%🔗 Quick Links
|
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.
New tests:
Bug fixes:
Also registers 'slow' mark in pytest.ini to suppress PytestUnknownMarkWarning
Work Item / Issue Reference
Summary
This pull request adds several new high-scale stress tests and improves the configurability and coverage of both single-threaded and multi-threaded stress testing. The main updates include three new single-threaded stress tests for executemany with mixed types, NULL-heavy result sets, and high-iteration cursor re-use, plus a fetchone vs fetchall parity test. Multi-threaded stress tests now support explicit pool size configuration and improved pool exhaustion testing. Test documentation and marker registration have also been updated.
Single-threaded stress test enhancements:
test_executemany_large_batch_mixed_typesto stress-testexecutemany()with 10,000 mixed-type rows, verifying parameter serialization and correctness.test_null_heavy_large_result_setto fetch 50,000 rows with 6/8 columns as NULL, ensuring correct NULL handling at scale.test_cursor_reuse_high_iterationto re-use a single cursor for 5,000 execute/fetch cycles, checking for memory leaks and state reset.test_fetchone_loop_vs_fetchall_parityto verify bit-identical results between fetchone() and fetchall() for 100,000 rows.Multi-threaded stress test improvements:
MultiThreadedQueryRunnernow accepts apool_max_sizeparameter, allowing explicit control of the connection pool size in tests. [1] [2]test_pool_exhaustion_recovery) now uses the explicit pool size parameter and improved query logic for more accurate stress simulation and reporting. [1] [2]Test marker and config updates:
slowpytest marker for extra-slow tests, complementing the existingstressmarker.These changes expand test coverage for edge-case and high-load scenarios, improve test documentation, and make stress tests more configurable and robust.