Skip to content

FEAT: Add stress test pipeline and migrate it to new 1ES Pool/Images#432

Merged
gargsaumya merged 9 commits intomainfrom
saumya/stress-tests-gh
Apr 6, 2026
Merged

FEAT: Add stress test pipeline and migrate it to new 1ES Pool/Images#432
gargsaumya merged 9 commits intomainfrom
saumya/stress-tests-gh

Conversation

@gargsaumya
Copy link
Copy Markdown
Contributor

@gargsaumya gargsaumya commented Feb 13, 2026

Work Item / Issue Reference

AB#41877

GitHub Issue: #<ISSUE_NUMBER>


Summary

This pull request adds a comprehensive suite of multi-threaded stress tests for the mssql-python package. The new tests cover a wide range of concurrency scenarios, sustained load, pool lifecycle, and heavy query scaling to ensure robust performance and stability under high-load conditions. The tests are cross-platform, feature deterministic shutdowns, and include adaptive validation of error rates.

Concurrency and load testing:

  • Added a concurrency matrix of tests (test_concurrency_matrix) that runs queries with varying thread counts and connection pooling settings, validating error rates at different concurrency levels.
  • Introduced sustained load tests (test_sustained_load) that run multiple threads for extended durations to simulate real-world high-load situations.
  • Implemented heavy query scaling tests (test_heavy_query_scaling) with large result sets and high thread counts to stress test the connection pool.

Connection pool management:

  • Added a pool lifecycle test (test_pool_lifecycle_cycles) to repeatedly enable and disable connection pooling, verifying deterministic shutdown and resource cleanup.
  • Provided utilities for strict thread joining and pool shutdown to ensure clean test teardown and avoid resource leaks.

Test infrastructure and utilities:

  • Defined data models (ThreadResult, StressResult) and a runner class (MultiThreadedQueryRunner) for collecting detailed metrics and managing

Copilot AI review requested due to automatic review settings February 13, 2026 05:33
@github-actions github-actions bot added the pr-size: large Substantial code update label Feb 13, 2026
@gargsaumya gargsaumya changed the title FEAT: Add stress test pipeline and multi-threaded stress tests FEAT: Add stress test pipeline and migrate it to use new 1ES Pool/Images Feb 13, 2026
@gargsaumya gargsaumya changed the title FEAT: Add stress test pipeline and migrate it to use new 1ES Pool/Images FEAT: Add stress test pipeline and migrate it to new 1ES Pool/Images Feb 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new scheduled/manual OneBranch pipeline to run stress testing and introduces a new multi-threaded stress test suite for mssql-python aimed at validating pooling and concurrency behavior under sustained and high-concurrency load.

Changes:

  • Added a new tests/test_020_multithreaded_stress.py module with multi-threaded stress tests and a helper runner/metrics models.
  • Added OneBranchPipelines/stress-test-pipeline.yml to run the stress suite on Windows (LocalDB) and Linux (Docker SQL Server) on a daily schedule or manually.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.

File Description
tests/test_020_multithreaded_stress.py New concurrency-focused stress tests with a multi-threaded runner and workload scenarios (matrix, sustained load, lifecycle, heavy queries).
OneBranchPipelines/stress-test-pipeline.yml New scheduled pipeline to provision DBs (LocalDB/Docker) and execute/publish stress + performance stress tests on Windows and Linux agents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gargsaumya gargsaumya force-pushed the saumya/stress-tests-gh branch from a62b99a to a7ac237 Compare February 13, 2026 06:34
@gargsaumya gargsaumya force-pushed the saumya/stress-tests-gh branch from a7ac237 to 96841c3 Compare February 13, 2026 06:37
@gargsaumya gargsaumya force-pushed the saumya/stress-tests-gh branch from 1673b0b to 51d6f81 Compare February 13, 2026 10:24
@gargsaumya
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@gargsaumya gargsaumya force-pushed the saumya/stress-tests-gh branch from ceb072c to 451ed2f Compare February 24, 2026 09:41
…n pipeline

- Replace @pytest.mark.stress_threading with @pytest.mark.stress in test_020_multithreaded_stress.py
- Update stress-test-pipeline.yml to use -m stress instead of -m stress_threading
- pytest.ini addopts = -m 'not stress' now covers both test_011 and test_020
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

78%


📈 Total Lines Covered: 6603 out of 8393
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No 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: 73.9%
mssql_python.pybind.connection.connection.cpp: 75.3%
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

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

@gargsaumya gargsaumya merged commit 57ed673 into main Apr 6, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: large Substantial code update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants