test_python_calls_appear_in_the_stack_if_perf_activated() of test_perf_profiler can fail if Linux perf logs "Warning: Processed 631 events and lost 1 chunks! Check IO/CPU overload!" to stderr. It can happen when the system load is high (ex: 41.21 on this buildbot below which has 20 CPUs).
We can strip "Warning: Processed 631 events and lost 1 chunks! Check IO/CPU overload!" from stderr or simply ignore stderr.
test_gdb also checks that gdb stderr is empty: it strips many known patterns to only fail if it gets an unexpected "error".
== CPython 3.16.0a0 (heads/main:fbeafc062e5, May 25 2026, 02:42:37) [GCC 15.2.1 20260123 (Red Hat 15.2.1-7)]
== Linux-7.0.9-104.fc43.aarch64-aarch64-with-glibc2.42 little-endian
== Python build: debug
== cwd: /var/lib/buildbot/worker/cstratak-fedora-stable-aarch64/3.x.cstratak-fedora-stable-aarch64.refleak/build/build/test_python_worker_2337271æ
== CPU count: 20
== encodings: locale=UTF-8 FS=utf-8
== resources: all,-cpu
Using random seed: 1170824138
0:00:00 load avg: 5.82 mem: 22.2 MiB Run 505 tests in parallel using 40 worker processes (timeout: 45 min, worker timeout: 50 min)
(...)
0:02:19 load avg: 41.21 mem: 1.6 GiB [207/505/1] test_perf_profiler failed (1 failure) (1 min 26 sec) -- running (30): test.test_asyncio.test_sock_lowlevel (48.0 sec), test.test_multiprocessing_fork.test_manager (1 min 2 sec), test.test_concurrent_futures.test_interpreter_pool (2 min 7 sec), test_external_inspection (46.2 sec), test_import (1 min 31 sec), test.test_multiprocessing_forkserver.test_threads (2 min 9 sec), test.test_asyncio.test_tasks (2 min 19 sec), test.test_multiprocessing_spawn.test_misc (1 min 23 sec), test.test_concurrent_futures.test_thread_pool (43.4 sec), test_pickle (1 min 2 sec), test_tarfile (2 min 3 sec), test_frame (1 min 6 sec), test_zipfile (2 min), test.test_asyncio.test_taskgroups (1 min 8 sec), test.test_concurrent_futures.test_as_completed (1 min 3 sec), test.test_multiprocessing_spawn.test_manager (1 min 41 sec), test_cmd_line (1 min 55 sec), test_ftplib (45.6 sec), test_bytes (1 min 10 sec), test_traceback (37.7 sec), test.test_multiprocessing_forkserver.test_manager (1 min 25 sec), test_imaplib (2 min 19 sec), test.test_concurrent_futures.test_shutdown (1 min 36 sec), test.test_multiprocessing_forkserver.test_misc (2 min 19 sec), test.test_multiprocessing_spawn.test_processes (2 min 16 sec), test_faulthandler (1 min 28 sec), test_interpreters (2 min 19 sec), test.test_concurrent_futures.test_init (1 min 2 sec), test_exceptions (1 min 20 sec), test_gc (58.5 sec)
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
test_pre_fork_compile (test.test_perf_profiler.TestPerfProfiler.test_pre_fork_compile) ... ok
test_python_calls_appear_in_the_stack_if_perf_activated (test.test_perf_profiler.TestPerfProfiler.test_python_calls_appear_in_the_stack_if_perf_activated) ... ok
test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated (test.test_perf_profiler.TestPerfProfiler.test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated) ... ok
test_python_calls_appear_in_the_stack_if_perf_activated (test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated) ... ok
test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated (test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated) ... ok
test_sys_api (test.test_perf_profiler.TestPerfTrampoline.test_sys_api) ... ok
test_sys_api_get_status (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_get_status) ... ok
test_sys_api_perf_jit_backend (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_perf_jit_backend) ... ok
test_sys_api_with_existing_perf_jit_trampoline (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_existing_perf_jit_trampoline) ... ok
test_sys_api_with_existing_trampoline (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_existing_trampoline) ... ok
test_sys_api_with_invalid_trampoline (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_invalid_trampoline) ... ok
test_trampoline_works (test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works) ... ok
test_trampoline_works_after_fork_with_many_code_objects (test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works_after_fork_with_many_code_objects) ... ok
test_trampoline_works_with_forks (test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works_with_forks) ... ok
----------------------------------------------------------------------
Ran 14 tests in 44.491s
OK
Xtest_pre_fork_compile (test.test_perf_profiler.TestPerfProfiler.test_pre_fork_compile) ... ok
test_python_calls_appear_in_the_stack_if_perf_activated (test.test_perf_profiler.TestPerfProfiler.test_python_calls_appear_in_the_stack_if_perf_activated) ... ok
test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated (test.test_perf_profiler.TestPerfProfiler.test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated) ... ok
test_python_calls_appear_in_the_stack_if_perf_activated (test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated) ... FAIL
test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated (test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated) ... ok
test_sys_api (test.test_perf_profiler.TestPerfTrampoline.test_sys_api) ... ok
test_sys_api_get_status (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_get_status) ... ok
test_sys_api_perf_jit_backend (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_perf_jit_backend) ... ok
test_sys_api_with_existing_perf_jit_trampoline (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_existing_perf_jit_trampoline) ... ok
test_sys_api_with_existing_trampoline (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_existing_trampoline) ... ok
test_sys_api_with_invalid_trampoline (test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_invalid_trampoline) ... ok
test_trampoline_works (test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works) ... ok
test_trampoline_works_after_fork_with_many_code_objects (test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works_after_fork_with_many_code_objects) ... ok
test_trampoline_works_with_forks (test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works_with_forks) ... ok
======================================================================
FAIL: test_python_calls_appear_in_the_stack_if_perf_activated (test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/buildbot/worker/cstratak-fedora-stable-aarch64/3.x.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_perf_profiler.py", line 449, in test_python_calls_appear_in_the_stack_if_perf_activated
self.assertEqual(stderr, "")
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 631 events and lost 1[34 chars]\n\n' != ''
- Warning:
- Processed 631 events and lost 1 chunks!
-
- Check IO/CPU overload!
-
----------------------------------------------------------------------
Ran 14 tests in 39.158s
FAILED (failures=1)
test test_perf_profiler failed
test_python_calls_appear_in_the_stack_if_perf_activated() of test_perf_profiler can fail if Linux perf logs "Warning: Processed 631 events and lost 1 chunks! Check IO/CPU overload!" to stderr. It can happen when the system load is high (ex:
41.21on this buildbot below which has 20 CPUs).We can strip "Warning: Processed 631 events and lost 1 chunks! Check IO/CPU overload!" from stderr or simply ignore stderr.
test_gdb also checks that gdb stderr is empty: it strips many known patterns to only fail if it gets an unexpected "error".
Multiple
test_perf_profilertests check that stderr is empty:aarch64 Fedora Stable Refleaks 3.x: https://buildbot.python.org/#/builders/123/builds/1938