Commit 87fe775
committed
gh-142368: Refactor test_external_inspection to reduce flakiness in parallel execution
The test file suffered from race conditions and resource exhaustion when
running with multiple workers. The main culprit was
test_async_global_awaited_by creating 1000 concurrent socket
connections, which combined with parallel test execution could easily
exhaust file descriptors. Reducing this to 100 tasks maintains test
coverage while staying well within system limits.
The refactoring consolidates duplicated socket setup, signal waiting,
and subprocess cleanup patterns into module-level helpers with proper
timeout and EOF handling. A base class now provides shared assertion
methods for finding frames and threads in stack traces. The subprocess
cleanup sequence was standardized to terminate first, then kill if
needed, avoiding the previous inconsistent patterns that could leave
zombie processes.1 parent 14715e3 commit 87fe775
1 file changed
Lines changed: 1125 additions & 1231 deletions
0 commit comments