https://github.com/python/cpython/commit/c4cc5d58aee6a3be55a95efee6ec25d5774f7b5f
commit: c4cc5d58aee6a3be55a95efee6ec25d5774f7b5f
branch: main
author: Gregory P. Smith <g...@krypto.org>
committer: gpshead <g...@krypto.org>
date: 2025-05-05T04:41:22Z
summary:

[GH-133419] fix test_external_inspection race assert (#133422)

[tests] fix test_external_inspection race assert

either line could be where the inspection finds the foo()
function as after ready is sent, the process may not have made progress
onto the next line yet.  "solve" by putting the statements on the same
line.

files:
M Lib/test/test_external_inspection.py

diff --git a/Lib/test/test_external_inspection.py 
b/Lib/test/test_external_inspection.py
index 40c21c830c0436..a2bce4781df015 100644
--- a/Lib/test/test_external_inspection.py
+++ b/Lib/test/test_external_inspection.py
@@ -59,8 +59,7 @@ def baz():
                 foo()
 
             def foo():
-                sock.sendall(b"ready")
-                time.sleep(1000)
+                sock.sendall(b"ready"); time.sleep(1000)  # same line number
 
             bar()
             """
@@ -96,10 +95,10 @@ def foo():
                 p.wait(timeout=SHORT_TIMEOUT)
 
             expected_stack_trace = [
-                ("foo", script_name, 15),
+                ("foo", script_name, 14),
                 ("baz", script_name, 11),
                 ("bar", script_name, 9),
-                ("<module>", script_name, 17),
+                ("<module>", script_name, 16),
             ]
             self.assertEqual(stack_trace, expected_stack_trace)
 

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to