]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-138122: Make sampling profiler integration tests more resilient (#142382)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Sun, 7 Dec 2025 22:41:15 +0000 (22:41 +0000)
committerGitHub <noreply@github.com>
Sun, 7 Dec 2025 22:41:15 +0000 (22:41 +0000)
commitef51a7c8f3f4511ad18ee310798883d15bc6d9b7
tree59822cdaadf1a58b9812a8993ab48a4da664fc55
parentff2577f56eb2170ef0afafa90f78c693df7ca562
gh-138122: Make sampling profiler integration tests more resilient (#142382)

The tests were flaky on slow machines because subprocesses could finish
before enough samples were collected. This adds synchronization similar
to test_external_inspection: test scripts now signal when they start
working, and the profiler waits for this signal before sampling.

Test scripts now run in infinite loops until killed rather than for
fixed iterations, ensuring the profiler always has active work to
sample regardless of machine speed.
Lib/test/test_profiling/test_sampling_profiler/helpers.py
Lib/test/test_profiling/test_sampling_profiler/test_advanced.py
Lib/test/test_profiling/test_sampling_profiler/test_integration.py
Lib/test/test_profiling/test_sampling_profiler/test_modes.py