From e9aee87cf4be1dcdd803cf385df5fe60d98abeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 13 Oct 2023 03:55:25 +0100 Subject: [PATCH 1/2] GH-110796: fix intermittent test failure in test_current_exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- Lib/test/test_sys.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 42ee6a46679369..9790e93af991ee 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -511,7 +511,7 @@ def test_current_exceptions(self): # Spawn a thread that blocks at a known place. Then the main # thread does sys._current_frames(), and verifies that the frames # returned make sense. - entered_g = threading.Event() + g_raised = threading.Event() leave_g = threading.Event() thread_info = [] # the thread's id @@ -520,17 +520,17 @@ def f123(): def g456(): thread_info.append(threading.get_ident()) - entered_g.set() while True: try: raise ValueError("oops") except ValueError: + g_raised.set() if leave_g.wait(timeout=support.LONG_TIMEOUT): break t = threading.Thread(target=f123) t.start() - entered_g.wait() + g_raised.wait(timeout=support.LONG_TIMEOUT) try: # At this point, t has finished its entered_g.set(), although it's From c6e645f5672adca16044da858e4c087e1c7d3dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 13 Oct 2023 06:57:14 +0100 Subject: [PATCH 2/2] remove outdated comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- Lib/test/test_sys.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 9790e93af991ee..da213506151594 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -533,9 +533,6 @@ def g456(): g_raised.wait(timeout=support.LONG_TIMEOUT) try: - # At this point, t has finished its entered_g.set(), although it's - # impossible to guess whether it's still on that line or has moved on - # to its leave_g.wait(). self.assertEqual(len(thread_info), 1) thread_id = thread_info[0]