Commit d9b8d13
committed
gh-144766: Fix flaky test_trampoline_works_with_forks
The fork child ran full Python finalization instead of calling
os._exit(0), which is fragile when perf trampoline support is active
(unmapping executable memory and unregistering code watchers during
finalization can crash intermittently). The newer test added in the
same file (test_trampoline_works_after_fork_with_many_code_objects)
already uses os._exit(0) for this reason.
Also fix the parent's wait status handling: os.waitpid returns a raw
wait status, not an exit code. Use os.WEXITSTATUS to extract the
actual exit code, and check os.WIFSIGNALED for signal deaths.
<claude>1 parent cb76ab3 commit d9b8d13
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
0 commit comments