8000 gh-109700: Improve stress tests for interpreter creation by serhiy-storchaka · Pull Request #109946 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109700: Improve stress tests for interpreter creation #109946

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
Changes from 1 commit
Commits
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
Next Next commit
WIP: gh-109700: Make stress tests on interpreter creation more stressful
  • Loading branch information
serhiy-storchaka committed Sep 27, 2023
commit 91af60c47b79eff241cf545a4e193c3d2c946fb7
10 changes: 8 additions & 2 deletions Lib/test/test_interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,22 @@ def test_create_many_sequential(self):
for _ in range(100):
interp = interpreters.create()
alive.append(interp)
del alive
support.gc_collect()

@support.requires_resource('cpu')
def test_create_many_threaded(self):
alive = []
start = threading.Event()
def task():
start.wait(10)
interp = interpreters.create()
alive.append(interp)
threads = (threading.Thread(target=task) for _ in range(200))
threads = [threading.Thread(target=task) for _ in range(200)]
with threading_helper.start_threads(threads):
pass
start.set()
del alive
support.gc_collect()


class TestIsShareable(TestBase):
Expand Down
0