diff options
author | Filipe LaĆns <lains@riseup.net> | 2023-10-13 06:26:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 06:26:27 (GMT) |
commit | 2f59d418cf19ded355934da168729d12cbb94645 (patch) | |
tree | 41430913757810facd64b77add4d5b4307c53f00 /Lib/test | |
parent | 6478dea3c8aca7147d013d6d7f5bf7805b300589 (diff) | |
download | cpython-2f59d418cf19ded355934da168729d12cbb94645.zip cpython-2f59d418cf19ded355934da168729d12cbb94645.tar.gz cpython-2f59d418cf19ded355934da168729d12cbb94645.tar.bz2 |
GH-110796: fix intermittent test failure in test_current_exceptions
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_sys.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 42ee6a4..da21350 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -511,7 +511,7 @@ class SysModuleTest(unittest.TestCase): # 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,22 +520,19 @@ class SysModuleTest(unittest.TestCase): 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 - # 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] |