Skip to content

Commit 4b2da91

Browse files
committed
Fix CI test failure: Prevent parallel execution of telemetry tests
Add @pytest.mark.xdist_group to telemetry test classes to ensure they run sequentially on the same worker when using pytest-xdist (-n auto). Root cause: Tests marked @pytest.mark.serial were still being parallelized in CI because pytest-xdist doesn't respect custom markers by default. With host-level telemetry batching (PR #718), tests running in parallel would share the same TelemetryClient and interfere with each other's event counting, causing test_concurrent_queries_sends_telemetry to see 88 events instead of the expected 60. The xdist_group marker ensures all tests in the "serial_telemetry" group run on the same worker sequentially, preventing state interference. Signed-off-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 2a1e6c9 commit 4b2da91

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tests/e2e/test_concurrent_telemetry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def run_in_threads(target, num_threads, pass_index=False):
2727

2828

2929
@pytest.mark.serial
30+
@pytest.mark.xdist_group(name="serial_telemetry")
3031
class TestE2ETelemetry(PySQLPytestTestCase):
3132
@pytest.fixture(autouse=True)
3233
def telemetry_setup_teardown(self):

tests/e2e/test_telemetry_e2e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def connection(self, extra_params=()):
4444

4545

4646
@pytest.mark.serial
47+
@pytest.mark.xdist_group(name="serial_telemetry")
4748
class TestTelemetryE2E(TelemetryTestBase):
4849
"""E2E tests for telemetry scenarios - must run serially due to shared host-level telemetry client"""
4950

0 commit comments

Comments
 (0)