summaryrefslogtreecommitdiffstats
path: root/Lib/test/support/strace_helper.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-127747: Resolve BytesWarning in test.support.strace_helper (#127849)Cody Maloney2024-12-141-4/+5
| | | | | | | | | | | | | | | | | | | | | The strace_helper code has a _make_error function to simplify making StraceResult objects in error cases. That takes a details parameter which is either a caught OSError or `bytes`. If it's bytes, _make_error would implicitly coerce that to a str inside of a f-string, resulting in a BytesWarning. It's useful to see if it's an OSError or bytes when debugging, resolve by changing to format with repr(). This is an error message on an internal helper. A non-zero exit code occurs if the strace binary isn't found, and no events will be parsed in that case (there is no output). Handle that case by checking exit code before checking for events. Still asserting around events rather than returning false, so that hopefully if there's some change to `strace` that breaks the parsing, will see that as a test failure rather than silently loosing strace tests because they are auto-disabled.
* gh-127076: Ignore memory mmap in FileIO testing (#127088)Cody Maloney2024-11-221-5/+29
| | | | | | | | | | | | | `mmap`, `munmap`, and `mprotect` are used by CPython for memory management, which may occur in the middle of the FileIO tests. The system calls can also be used with files, so `strace` includes them in its `%file` and `%desc` filters. Filter out the `mmap` system calls related to memory allocation for the file tests. Currently FileIO doesn't do `mmap` at all, so didn't add code to track from `mmap` through `munmap` since it wouldn't be used. For now if an `mmap` on a fd happens, the call will be included (which may cause test to fail), and at that time support for tracking the address throug `munmap` could be added.
* gh-127076: Disable strace tests under LD_PRELOAD (#127086)Cody Maloney2024-11-211-0/+8
| | | | | | | | Distribution tooling (ex. sandbox on Gentoo and fakeroot on Debian) uses LD_PRELOAD to intercept system calls and potentially modify them when building. These tools can change the set of system calls, so disable system call testing under these cases. Co-authored-by: Michał Górny <mgorny@gentoo.org>
* GH-126892: Reset warmup counters when JIT compiling code (GH-126893)Brandt Bucher2024-11-201-1/+4
|
* gh-120754: Add a strace helper and test set of syscalls for open().read(), ↵Cody Maloney2024-11-031-0/+170
| | | | Take 2 (#123413)
* Revert "GH-120754: Add a strace helper and test set of syscalls for o… ↵Shantanu2024-08-241-166/+0
| | | | | | | (#123303) Revert "GH-120754: Add a strace helper and test set of syscalls for open().read() (#121143)" This reverts commit e38d0afe3548b856ccf0b05c01ed3eefc69cb3e7.
* GH-120754: Add a strace helper and test set of syscalls for open().read() ↵Cody Maloney2024-08-241-0/+166
(#121143)