René's URL Explorer Experiment


Title: gh-156082: Do not run tests using the same machine-wide resource at once by serhiy-storchaka · Pull Request #156902 · python/cpython · GitHub

Open Graph Title: gh-156082: Do not run tests using the same machine-wide resource at once by serhiy-storchaka · Pull Request #156902 · python/cpython

X Title: gh-156082: Do not run tests using the same machine-wide resource at once by serhiy-storchaka · Pull Request #156902 · python/cpython

Description: Two tests using the display, the sound device or the terminal at the same time interfere with each other. Running the GUI tests in parallel fails 100% of the time on Windows and about half the time on Linux. Add test.support.exclusive(resource), a decorator for a test method or a TestCase subclass, and test.support.requires_exclusive(resource) for a whole test file: support.requires_exclusive('gui') # next to requires('gui') @support.exclusive('gui') def test_focus(self): ... @support.exclusive('gui') class DialogTest(unittest.TestCase): ... requires(), requires_resource() and bigmemtest() (only for a real run) claim the resource themselves, so no existing test needs a change. The resources treated as machine-wide are audio, console, curses and gui, plus memory for bigmem tests. Each resource is a lock file in the directory which the test runner names in an environment variable. It sets it only when it runs more than one worker process, so a sequential run, -j1 and python -m unittest lock nothing. The lock is released by closing the file, so a test which crashes or is killed does not keep it. Tests using different resources still run in parallel; only tests using the same one wait for each other. They therefore no longer overlap: test_tkinter, test_ttk and test_idle with -j4 take 7.1 seconds instead of 3.5, which is the sum of their durations instead of the largest of them. 🤖 Generated with Claude Code Issue: gh-156082

Open Graph Description: Two tests using the display, the sound device or the terminal at the same time interfere with each other. Running the GUI tests in parallel fails 100% of the time on Windows and about half the tim...

X Description: Two tests using the display, the sound device or the terminal at the same time interfere with each other. Running the GUI tests in parallel fails 100% of the time on Windows and about half the tim...

Opengraph URL: https://github.com/python/cpython/pull/156902

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:03e1d531-6998-dc83-86f7-58d599de050c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAC48:29C715:F97C5C:14BCA57:6B064C5F
html-safe-nonceeb7a050704dcd9d5ca0d984532777f941c704ad504520b27e1f96ae7a5856759
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzQ4OjI5QzcxNTpGOTdDNUM6MTRCQ0E1Nzo2QjA2NEM1RiIsInZpc2l0b3JfaWQiOiIxMDg0ODc5NjU5NTQxNjEzNjYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf0c96c45cbf1036fad317b5f8f3ad0a48869790169f71e41ca64121018aabf46
hovercard-subject-tagpull_request:4434960585
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/156902/files
twitter:imagehttps://avatars.githubusercontent.com/u/3659035?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/3659035?s=400&v=4
og:image:altTwo tests using the display, the sound device or the terminal at the same time interfere with each other. Running the GUI tests in parallel fails 100% of the time on Windows and about half the tim...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None772b6997ca4daa0428dd49a25d76052e765555ae560fe9c88517eb828bbd861e
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef1f9a08f7c769a37f1dfc18ad43d463c222a7eea
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/156902/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F156902%2Ffiles
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%2Fpull%2F156902%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/156902/files
Reloadhttps://github.com/python/cpython/pull/156902/files
Reloadhttps://github.com/python/cpython/pull/156902/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
serhiy-storchakahttps://github.com/serhiy-storchaka
python:mainhttps://github.com/python/cpython/tree/main
serhiy-storchaka:test-support-exclusive-resourcehttps://github.com/serhiy-storchaka/cpython/tree/test-support-exclusive-resource
Conversation 21 https://github.com/python/cpython/pull/156902
Commits 4 https://github.com/python/cpython/pull/156902/commits
Checks 61 https://github.com/python/cpython/pull/156902/checks
Files changed https://github.com/python/cpython/pull/156902/files
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
gh-156082: Do not run tests using the same machine-wide resource at once https://github.com/python/cpython/pull/156902/files#top
Show all changes 4 commits https://github.com/python/cpython/pull/156902/files
730794c gh-156082: Do not run tests using the same machine-wide resource at once serhiy-storchaka Aug 19, 2026 https://github.com/python/cpython/pull/156902/commits/730794cdf621fad874b6fc0aac90c7fa5ad89c42
3d90c43 Address the review serhiy-storchaka Sep 3, 2026 https://github.com/python/cpython/pull/156902/commits/3d90c4345c6fd045db1cdffdc9d80384b2b2ec74
ee13664 Let the tests of different users lock each other out serhiy-storchaka Sep 3, 2026 https://github.com/python/cpython/pull/156902/commits/ee13664a83b2113d649e750827e5e668716c9918
26a644c Address Terry's review serhiy-storchaka Nov 24, 2026 https://github.com/python/cpython/pull/156902/commits/26a644c6b1e159afad17d49179c21794df592aae
Clear filters https://github.com/python/cpython/pull/156902/files
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
test.rst https://github.com/python/cpython/pull/156902/files#diff-9c776940ef00f1a36f9b8acab3dee7d70f992af8a03fbe01f5973ff9e2bcd454
run_workers.py https://github.com/python/cpython/pull/156902/files#diff-661ff42228bba9dd40f2e70875475a4407f22fe88b10e0081e9c8ad1ae6ac935
__init__.py https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
2026-08-19-21-35-06.gh-issue-156082.fvnqct.rst https://github.com/python/cpython/pull/156902/files#diff-b2735c66a8e13e61b8c389ba9b8248ce1005759be0088a90a420d0214a657d3f
Doc/library/test.rsthttps://github.com/python/cpython/pull/156902/files#diff-9c776940ef00f1a36f9b8acab3dee7d70f992af8a03fbe01f5973ff9e2bcd454
View file https://github.com/python/cpython/blob/26a644c6b1e159afad17d49179c21794df592aae/Doc/library/test.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156902/{{ revealButtonHref }}
https://github.com/python/cpython/pull/156902/files#diff-9c776940ef00f1a36f9b8acab3dee7d70f992af8a03fbe01f5973ff9e2bcd454
https://github.com/python/cpython/pull/156902/files#diff-9c776940ef00f1a36f9b8acab3dee7d70f992af8a03fbe01f5973ff9e2bcd454
Lib/test/libregrtest/run_workers.pyhttps://github.com/python/cpython/pull/156902/files#diff-661ff42228bba9dd40f2e70875475a4407f22fe88b10e0081e9c8ad1ae6ac935
View file https://github.com/python/cpython/blob/26a644c6b1e159afad17d49179c21794df592aae/Lib/test/libregrtest/run_workers.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156902/{{ revealButtonHref }}
https://github.com/python/cpython/pull/156902/files#diff-661ff42228bba9dd40f2e70875475a4407f22fe88b10e0081e9c8ad1ae6ac935
https://github.com/python/cpython/pull/156902/files#diff-661ff42228bba9dd40f2e70875475a4407f22fe88b10e0081e9c8ad1ae6ac935
https://github.com/python/cpython/pull/156902/files#diff-661ff42228bba9dd40f2e70875475a4407f22fe88b10e0081e9c8ad1ae6ac935
Lib/test/support/__init__.pyhttps://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
View file https://github.com/python/cpython/blob/26a644c6b1e159afad17d49179c21794df592aae/Lib/test/support/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156902/{{ revealButtonHref }}
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
terryjreedyhttps://github.com/terryjreedy
Nov 23, 2026https://github.com/python/cpython/pull/156902/files#r4673096010
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
serhiy-storchakahttps://github.com/serhiy-storchaka
Nov 24, 2026https://github.com/python/cpython/pull/156902/files#r4682039569
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
vstinnerhttps://github.com/vstinner
Sep 3, 2026https://github.com/python/cpython/pull/156902/files#r3927369394
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
vstinnerhttps://github.com/vstinner
Sep 3, 2026https://github.com/python/cpython/pull/156902/files#r3927434797
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
serhiy-storchakahttps://github.com/serhiy-storchaka
Sep 3, 2026https://github.com/python/cpython/pull/156902/files#r3927780669
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
serhiy-storchakahttps://github.com/serhiy-storchaka
Sep 4, 2026https://github.com/python/cpython/pull/156902/files#r3934518936
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/156902/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
Misc/NEWS.d/next/Tests/2026-08-19-21-35-06.gh-issue-156082.fvnqct.rsthttps://github.com/python/cpython/pull/156902/files#diff-b2735c66a8e13e61b8c389ba9b8248ce1005759be0088a90a420d0214a657d3f
View file https://github.com/python/cpython/blob/26a644c6b1e159afad17d49179c21794df592aae/Misc/NEWS.d/next/Tests/2026-08-19-21-35-06.gh-issue-156082.fvnqct.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/156902/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/156902/files
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.