Skip to content

Commit 7e21f87

Browse files
gpsheadPranjal095
authored andcommitted
[pythonGH-133419] fix test_external_inspection race assert (python#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.
1 parent 92c51d9 commit 7e21f87

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/test/test_external_inspection.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def baz():
5959
foo()
6060
6161
def foo():
62-
sock.sendall(b"ready")
63-
time.sleep(1000)
62+
sock.sendall(b"ready"); time.sleep(1000) # same line number
6463
6564
bar()
6665
"""
@@ -96,10 +95,10 @@ def foo():
9695
p.wait(timeout=SHORT_TIMEOUT)
9796

9897
expected_stack_trace = [
99-
("foo", script_name, 15),
98+
("foo", script_name, 14),
10099
("baz", script_name, 11),
101100
("bar", script_name, 9),
102-
("<module>", script_name, 17),
101+
("<module>", script_name, 16),
103102
]
104103
self.assertEqual(stack_trace, expected_stack_trace)
105104

0 commit comments

Comments
 (0)