René's URL Explorer Experiment


Title: `test_is_python_process_non_python_subprocess` always times out when `sleep` is a multicall binary (Alpine/BusyBox, RHEL UBI9) · Issue #160881 · python/cpython · GitHub

Open Graph Title: `test_is_python_process_non_python_subprocess` always times out when `sleep` is a multicall binary (Alpine/BusyBox, RHEL UBI9) · Issue #160881 · python/cpython

X Title: `test_is_python_process_non_python_subprocess` always times out when `sleep` is a multicall binary (Alpine/BusyBox, RHEL UBI9) · Issue #160881 · python/cpython

Description: Bug report Bug description: The fix for gh-159534 (GH-160028, backported to 3.15 in GH-160080) makes test_is_python_process_non_python_subprocess fail every time on systems where sleep is provided by a multicall binary. That includes the...

Open Graph Description: Bug report Bug description: The fix for gh-159534 (GH-160028, backported to 3.15 in GH-160080) makes test_is_python_process_non_python_subprocess fail every time on systems where sleep is provided ...

X Description: Bug report Bug description: The fix for gh-159534 (GH-160028, backported to 3.15 in GH-160080) makes test_is_python_process_non_python_subprocess fail every time on systems where sleep is provided ...

Opengraph URL: https://github.com/python/cpython/issues/160881

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`test_is_python_process_non_python_subprocess` always times out when `sleep` is a multicall binary (Alpine/BusyBox, RHEL UBI9)","articleBody":"### Bug report\n\n### Bug description:\n\nThe fix for gh-159534 (GH-160028, backported to 3.15 in GH-160080) makes `test_is_python_process_non_python_subprocess` fail every time on systems where `sleep` is provided by a multicall binary. That includes the Alpine buildbots, where the original gh-159534 failure was found:\n\n```\nFAIL: test_is_python_process_non_python_subprocess (test.test_profiling.test_sampling_profiler.test_children.TestIsPythonProcess.test_is_python_process_non_python_subprocess)\nTest that a non-Python subprocess is not detected as Python.\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \".../Lib/test/test_profiling/test_sampling_profiler/test_children.py\", line 628, in test_is_python_process_non_python_subprocess\n    _wait_for_process_exec(proc, \"sleep\", SHORT_TIMEOUT)\n  File \".../Lib/test/test_profiling/test_sampling_profiler/test_children.py\", line 91, in _wait_for_process_exec\n    for _ in sleeping_retry(timeout, max_delay=0.1):\n  File \".../Lib/test/support/__init__.py\", line 2779, in sleeping_retry\n    for _ in busy_retry(timeout, err_msg, error=error):\n  File \".../Lib/test/support/__init__.py\", line 2749, in busy_retry\n    raise AssertionError(msg)\nAssertionError: timeout (45.1 seconds)\n```\n\n#### Buildbots\n\nAMD64 Alpine Linux NoGIL 3.x:\n- [build 3444](https://buildbot.python.org/#/builders/1819/builds/3444) (before GH-160028): the original intermittent failure, `True is not false`.\n- [build 3445](https://buildbot.python.org/#/builders/1819/builds/3445) (first build with GH-160028): `timeout (45.1 seconds)`. Every build since fails the same way, e.g. [build 3523](https://buildbot.python.org/#/builders/1819/builds/3523).\n\nAMD64 Alpine Linux 3.15:\n- [build 800](https://buildbot.python.org/#/builders/2114/builds/800) (before GH-160080): only `test_lazy_import` fails.\n- [build 815](https://buildbot.python.org/#/builders/2114/builds/815) (first build with GH-160080) and every build since, including [build 851](https://buildbot.python.org/#/builders/2114/builds/851) just before v3.15.2 was tagged: this test fails too.\n\nThis failure is separate from the `test_lazy_import` crash on Alpine (gh-159535). The Alpine builders will stay red after that crash is fixed.\n\n#### Cause\n\nThe new `_wait_for_process_exec()` helper waits until `os.path.basename(os.readlink(f\"/proc/{pid}/exe\")) == \"sleep\"`. When `sleep` is a multicall binary, `/proc/{pid}/exe` points to the multicall binary instead:\n\n| System | `/usr/bin/sleep` or `/bin/sleep` | `/proc/{pid}/exe` of a running `sleep` |\n|---|---|---|\n| Alpine 3.24 (BusyBox) | symlink to `/bin/busybox` | `/bin/busybox` |\n| RHEL UBI9 (`coreutils-single`, the image default) | shebang script `#!/usr/bin/coreutils --coreutils-prog-shebang=sleep` | `/usr/bin/coreutils` |\n| RHEL UBI9 after `dnf swap coreutils-single coreutils` | regular binary | `/usr/bin/sleep` |\n\nThe condition never becomes true, so the test always times out.\n\nReproducer, tested in `python:3-alpine` and `registry.access.redhat.com/ubi9/ubi`:\n\n```python\nimport os, subprocess, time\nproc = subprocess.Popen([\"sleep\", \"10\"])\ntime.sleep(0.5)\nprint(os.readlink(f\"/proc/{proc.pid}/exe\"))\nproc.kill()\n```\n\n### Suggested fix\n\nThe helper only needs to know that the child has called `exec()`. The program name doesn't matter. Before `exec()`, the forked child's `/proc/{pid}/exe` is the parent's Python executable, so wait until it differs from the parent's:\n\n```diff\n-def _wait_for_process_exec(proc, name, timeout):\n+def _wait_for_process_exec(proc, timeout):\n     # Wait until a child process calls exec() to replace the forked process\n-    # executable. Raise AssertionError on timeout.\n+    # executable. Don't check the executable name: it can be a multicall\n+    # binary such as /bin/busybox. Raise AssertionError on timeout.\n+    parent_exe = os.readlink(\"/proc/self/exe\")\n     for _ in sleeping_retry(timeout, max_delay=0.1):\n         exe = os.readlink(f\"/proc/{proc.pid}/exe\")\n-        if os.path.basename(exe) == name:\n+        if exe != parent_exe:\n             break\n```\n\n```diff\n-            _wait_for_process_exec(proc, \"sleep\", SHORT_TIMEOUT)\n+            _wait_for_process_exec(proc, SHORT_TIMEOUT)\n```\n\nI tested this check with the reproducer on Alpine (BusyBox) and on UBI9 with both `coreutils-single` and `coreutils`. It detects the `exec()` in all three cases, while the current name check fails on Alpine and on UBI9 with `coreutils-single`.\n\n### CPython versions tested on:\n\n3.15.2, CPython main branch\n\n### Operating systems tested on:\n\nLinux (Alpine 3.24 buildbots, RHEL UBI9 container)\n\n\n### CPython versions tested on:\n\n3.15\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-160901\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/thomgree","@type":"Person","name":"thomgree"},"datePublished":"2026-10-29T10:57:33Z","url":"https://github.com/python/cpython/issues/160881"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6764ce9a-417f-19e2-27ac-e9c07486d792
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id832C:23DB5F:1058B76:14832B3:6B023F39
html-safe-nonce2822816220b3c9868137df60dcc65793233f94de292ccf98907098c42bda1d08
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzJDOjIzREI1RjoxMDU4Qjc2OjE0ODMyQjM6NkIwMjNGMzkiLCJ2aXNpdG9yX2lkIjoiMjM1MDY2NTE3ODA0MDkwOTYyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc0e29b4a7b7bbc441cb60d2a7c4dc0e6ce3cabee9ef9a5c85a10ab3ac438f33a
hovercard-subject-tagissue:6098178744
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/160881/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c5fb05ca8642d95cfe0b611e5efe0caa75eab246869df7a703945c5438249173/python/cpython/issues/160881
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c5fb05ca8642d95cfe0b611e5efe0caa75eab246869df7a703945c5438249173/python/cpython/issues/160881
og:image:altBug report Bug description: The fix for gh-159534 (GH-160028, backported to 3.15 in GH-160080) makes test_is_python_process_non_python_subprocess fail every time on systems where sleep is provided ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamethomgree
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/160881#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F160881
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F160881
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/160881
Reloadhttps://github.com/python/cpython/issues/160881
Reloadhttps://github.com/python/cpython/issues/160881
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/160881
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/160881
test_is_python_process_non_python_subprocess always times out when sleep is a multicall binary (Alpine/BusyBox, RHEL UBI9)https://github.com/python/cpython/issues/160881#top
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-profilinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-profiling%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/thomgree
thomgreehttps://github.com/thomgree
on Oct 29, 2026https://github.com/python/cpython/issues/160881#issue-6098178744
gh-159534https://github.com/python/cpython/issues/159534
GH-160028https://github.com/python/cpython/pull/160028
GH-160080https://github.com/python/cpython/pull/160080
gh-159534https://github.com/python/cpython/issues/159534
build 3444https://buildbot.python.org/#/builders/1819/builds/3444
gh-159534: Fix race condition in test_sampling_profiler #160028https://github.com/python/cpython/pull/160028
build 3445https://buildbot.python.org/#/builders/1819/builds/3445
gh-159534: Fix race condition in test_sampling_profiler #160028https://github.com/python/cpython/pull/160028
build 3523https://buildbot.python.org/#/builders/1819/builds/3523
build 800https://buildbot.python.org/#/builders/2114/builds/800
[3.15] gh-159534: Fix race condition in test_sampling_profiler (GH-160028) #160080https://github.com/python/cpython/pull/160080
build 815https://buildbot.python.org/#/builders/2114/builds/815
[3.15] gh-159534: Fix race condition in test_sampling_profiler (GH-160028) #160080https://github.com/python/cpython/pull/160080
build 851https://buildbot.python.org/#/builders/2114/builds/851
gh-159535https://github.com/python/cpython/issues/159535
gh-160881: Fix test_is_python_process_non_python_subprocess with multicall sleep #160901https://github.com/python/cpython/pull/160901
thomgreehttps://github.com/thomgree
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 29, 2026https://github.com/python/cpython/issues/160881#event-34575633018
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 29, 2026https://github.com/python/cpython/issues/160881#issuecomment-6495327091
NekoAsakurahttps://github.com/NekoAsakura
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-profilinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-profiling%22
on Oct 29, 2026https://github.com/python/cpython/issues/160881#event-34586868175
thomgreehttps://github.com/thomgree
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 15, 2026https://github.com/python/cpython/issues/160881#event-36199931959
https://github.com/thomgree
thomgreehttps://github.com/thomgree
on Nov 15, 2026https://github.com/python/cpython/issues/160881#issuecomment-6897448286
#160529https://github.com/python/cpython/issues/160529
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/160881
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/160881
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-profilinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-profiling%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.