Skip to content

Commit 64ba6cf

Browse files
committed
Fix: use @pytest.mark.stress on test_020 to exclude from PR validation 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
1 parent 3544503 commit 64ba6cf

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

OneBranchPipelines/stress-test-pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
119119
$xmlFile = "stress-test-results.xml"
120120
$gracePeriod = 30
121-
$arguments = "-m pytest tests/test_020_multithreaded_stress.py -v -m stress_threading --junitxml=$xmlFile --timeout=3600 --capture=tee-sys"
121+
$arguments = "-m pytest tests/test_020_multithreaded_stress.py -v -m stress --junitxml=$xmlFile --timeout=3600 --capture=tee-sys"
122122
$process = Start-Process -FilePath "python" -ArgumentList $arguments -NoNewWindow -PassThru
123123
124124
# Poll: wait for process to exit or XML file to appear
@@ -305,7 +305,7 @@ jobs:
305305
cmd = [
306306
sys.executable, "-m", "pytest",
307307
"tests/test_020_multithreaded_stress.py",
308-
"-v", "-m", "stress_threading",
308+
"-v", "-m", "stress",
309309
"--junitxml=" + XML_FILE,
310310
"--timeout=3600",
311311
"--capture=tee-sys",
@@ -407,7 +407,7 @@ jobs:
407407
echo "Platform: Python-1ES-pool (PYTHON-1ES-MMS2022, PYTHON-1ES-UB2404)"
408408
echo ""
409409
echo "Tests executed:"
410-
echo " - test_020_multithreaded_stress.py (stress_threading marker)"
410+
echo " - test_020_multithreaded_stress.py (stress marker)"
411411
echo " - test_011_singlethreaded_stress.py (stress marker)"
412412
echo ""
413413
echo "See individual job results for details."

tests/test_020_multithreaded_stress.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Memory and resource usage under load
99
- Race condition detection
1010
11-
Tests are marked with @pytest.mark.stress_threading and are designed to be run
11+
Tests are marked with @pytest.mark.stress and are designed to be run
1212
in a dedicated pipeline separate from regular CI tests.
1313
1414
Inspired by: https://github.com/saurabh500/sqlclientrepros/tree/master/python/standalone
@@ -378,7 +378,7 @@ def stress_conn_str():
378378
# ============================================================================
379379

380380

381-
@pytest.mark.stress_threading
381+
@pytest.mark.stress
382382
@pytest.mark.parametrize(
383383
"num_threads,iterations",
384384
[
@@ -409,7 +409,7 @@ def test_basic_multithreaded_queries(stress_conn_str, num_threads, iterations):
409409
)
410410

411411

412-
@pytest.mark.stress_threading
412+
@pytest.mark.stress
413413
@pytest.mark.parametrize(
414414
"num_threads,iterations",
415415
[
@@ -444,7 +444,7 @@ def test_basic_multithreaded_without_pooling(stress_conn_str, num_threads, itera
444444
# ============================================================================
445445

446446

447-
@pytest.mark.stress_threading
447+
@pytest.mark.stress
448448
@pytest.mark.parametrize(
449449
"num_threads,iterations",
450450
[
@@ -478,7 +478,7 @@ def test_medium_load_multithreaded(stress_conn_str, num_threads, iterations):
478478
)
479479

480480

481-
@pytest.mark.stress_threading
481+
@pytest.mark.stress
482482
def test_50_threads_data_integrity(stress_conn_str):
483483
"""
484484
Test data integrity with 50 concurrent threads.
@@ -576,7 +576,7 @@ def worker(thread_id: int):
576576
# ============================================================================
577577

578578

579-
@pytest.mark.stress_threading
579+
@pytest.mark.stress
580580
def test_normal_load_cpu_cores(stress_conn_str):
581581
"""
582582
Test with normal/realistic thread count matching CPU core count.
@@ -640,7 +640,7 @@ def test_normal_load_cpu_cores(stress_conn_str):
640640
# ============================================================================
641641

642642

643-
@pytest.mark.stress_threading
643+
@pytest.mark.stress
644644
@pytest.mark.parametrize(
645645
"num_threads,iterations",
646646
[
@@ -674,7 +674,7 @@ def test_high_load_100_threads(stress_conn_str, num_threads, iterations):
674674
print(f"[PASSED] 100 threads test: {result.throughput_qps:.1f} qps")
675675

676676

677-
@pytest.mark.stress_threading
677+
@pytest.mark.stress
678678
@pytest.mark.slow
679679
def test_extreme_load_2x_cpu_cores(stress_conn_str):
680680
"""
@@ -719,7 +719,7 @@ def test_extreme_load_2x_cpu_cores(stress_conn_str):
719719
# ============================================================================
720720

721721

722-
@pytest.mark.stress_threading
722+
@pytest.mark.stress
723723
def test_pool_exhaustion_recovery(stress_conn_str):
724724
"""
725725
Test that the driver recovers gracefully when connection pool is exhausted.
@@ -753,7 +753,7 @@ def test_pool_exhaustion_recovery(stress_conn_str):
753753
)
754754

755755

756-
@pytest.mark.stress_threading
756+
@pytest.mark.stress
757757
def test_rapid_pool_enable_disable(stress_conn_str):
758758
"""
759759
Test rapid enabling and disabling of connection pooling.
@@ -808,7 +808,7 @@ def query_worker(worker_id: int):
808808
# ============================================================================
809809

810810

811-
@pytest.mark.stress_threading
811+
@pytest.mark.stress
812812
@pytest.mark.slow
813813
def test_sustained_load_5_minutes(stress_conn_str):
814814
"""
@@ -905,7 +905,7 @@ def memory_monitor():
905905
# ============================================================================
906906

907907

908-
@pytest.mark.stress_threading
908+
@pytest.mark.stress
909909
def test_complex_queries_multithreaded(stress_conn_str):
910910
"""
911911
Test multi-threaded execution with complex queries.
@@ -942,7 +942,7 @@ def test_complex_queries_multithreaded(stress_conn_str):
942942
# ============================================================================
943943

944944

945-
@pytest.mark.stress_threading
945+
@pytest.mark.stress
946946
def test_resource_cleanup_after_stress(stress_conn_str):
947947
"""
948948
Test that resources are properly cleaned up after stress.
@@ -985,7 +985,7 @@ def test_resource_cleanup_after_stress(stress_conn_str):
985985
# ============================================================================
986986

987987

988-
@pytest.mark.stress_threading
988+
@pytest.mark.stress
989989
@pytest.mark.parametrize(
990990
"num_threads,iterations,pooling",
991991
[

0 commit comments

Comments
 (0)