bpo-37224: Using threading.Event to make sure the thread is running already.#26598
bpo-37224: Using threading.Event to make sure the thread is running already.#26598shihai1991 wants to merge 1 commit into
Conversation
|
Hi, Victor, Eric. Would you mind to take a look this PR? @vstinner @ericsnowcurrently I don't catch the error again by |
Sorry, something went wrong.
|
In fact, there have two types of error:
|
Sorry, something went wrong.
Ok. Thanks, Eric. Looks like I need to get to the bottom of this. I get this error again :( my second patch is: diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py
index 7baea69a4e5..2b2a3d4bd7d 100644
--- a/Lib/test/test__xxsubinterpreters.py
+++ b/Lib/test/test__xxsubinterpreters.py
@@ -42,8 +42,13 @@ def _run_output(interp, request, shared=None):
@contextlib.contextmanager
def _running(interp):
r, w = os.pipe()
+ # [bpo-37224](https://bugs.python.org/issue37224): Using threading.Event to make sure
+ # the interpreter is running already.
+ done = threading.Event()
+ print(interpreters.list_all())
def run():
interpreters.run_string(interp, dedent(f"""
+ {done.set()}
# wait for "signal"
with open({r}, encoding="utf-8") as rpipe:
rpipe.read()
@@ -51,6 +56,7 @@ def run():
t = threading.Thread(target=run)
t.start()
+ done.wait()
yield |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
This PR hasn't fix the failed test cases, I updated the analysis conclusion in https://bugs.python.org/issue37224#msg397809. |
Sorry, something went wrong.
https://bugs.python.org/issue37224