Skip to content

Commit cdb7a03

Browse files
SimplicityGuyclaude
andcommitted
test(extractor): clear active_connections before health data test
Fix test failure caused by residual state from parallel test execution. The test_get_health_data test was failing intermittently because the global active_connections dictionary retained entries from other tests running in parallel (pytest-xdist), causing the health status to be "extracting" instead of "healthy". Solution: Clear active_connections.clear() before checking health data to ensure clean test isolation. Fixes: tests/extractor/test_extractor.py::TestHealthMonitoring::test_get_health_data Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent d4ce181 commit cdb7a03

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/extractor/test_extractor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,12 @@ class TestHealthMonitoring:
943943

944944
def test_get_health_data(self) -> None:
945945
"""Test getting health data."""
946+
import extractor.pyextractor.extractor
946947
from extractor.pyextractor.extractor import get_health_data
947948

949+
# Clear any residual state from parallel tests
950+
extractor.pyextractor.extractor.active_connections.clear()
951+
948952
health = get_health_data()
949953

950954
assert "status" in health

0 commit comments

Comments
 (0)