8000 GH-120754: Add a strace helper and test set of syscalls for open().read() by cmaloney · Pull Request #121143 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-120754: Add a strace helper and test set of syscalls for open().read() #121143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Aug 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a44faf3
Add strace helper for tracing system calls made by python running spe…
cmaloney Jun 28, 2024
a462039
Update test_subprocess to use strace_helper
cmaloney Jun 28, 2024
2ab832d
Add test to FileIO that validates set of syscalls
cmaloney Jun 29, 2024
ef298f2
Move from assert to .assertEqual
cmaloney Jun 29, 2024
283a077
Allow libc to use different fstat variants
cmaloney Jun 29, 2024
3b6c094
Exit early if strace exited non-zero
cmaloney Jun 29, 2024
97b294f
Add myself to ACKS
cmaloney Jun 29, 2024
e5bdc6b
Add tests around pathilb read_*() behavior
cmaloney Jun 29, 2024
397cd9e
Remove subprocess._USE_VFORK strace test
cmaloney Jun 29, 2024
e88d414
Merge remote-tracking branch 'origin/main' into cmaloney/systrace_hel…
cmaloney Jul 4, 2024
d99157f
Update call sequence after gh-120755
cmaloney Jul 4, 2024
5664558
Add specific python bug links
cmaloney Jul 9, 2024
736d5bc
Reduce annotations, stay bytes longer, make raw_events non-private
cmaloney Jul 9, 2024
47ed7fe
Move _strace_working checks to all be in requires_strace
cmaloney Jul 9, 2024
55d1cec
formatting fixes, reduce annotations further
cmaloney Jul 10, 2024
6fe0961
Small cleanups from self review
cmaloney Jul 10, 2024
943b07d
Merge branch 'main' into cmaloney/systrace_helper_wip
cmaloney Jul 10, 2024
2ea2bc8
Adjust test cases to match more general system call shape
cmaloney Jul 10, 2024
cdf449a
raw_events -> event_bytes
cmaloney Jul 10, 2024
c44bca6
Add bits I forgot to commit
cmaloney Jul 10, 2024
0210d16
Merge remote-tracking branch 'main' into cmaloney/systrace_helper_wip
cmaloney Aug 1, 2024
a1b4028
Merge branch 'main' into cmaloney/systrace_helper_wip
cmaloney Aug 18, 2024
0c6ebe6
Switch to functools.cache, simplifying the code
cmaloney Aug 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Exit early if strace exited non-zero
  • Loading branch information
cmaloney committed Jun 29, 2024
commit 3b6c09441e365d9d05e90c4aaf542f3acbe04805
5 changes: 4 additions & 1 deletion Lib/test/support/strace_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def _make_error(reason, details):
except OSError as err:
return _make_error("Caught OSError", err)

if check and res.rc:
res.fail(cmd_line)

# Get out program returncode
decoded = res.err.decode().strip()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1) Always specify a codec on decode. BUT... (2) Instead of decoding here, it'd be better to leave output as bytes. There will be processes that do not emit valid encoded data.


Expand All @@ -108,7 +111,7 @@ def _make_error(reason, details):
output[1][:50])

python_returncode = int(returncode_match["returncode"])
if check and (res.rc or python_returncode):
if check and python_returncode:
res.fail(cmd_line)

return StraceResult(strace_returncode=res.rc,
Expand Down
Loading
0