Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133419: fix test_external_inspection race assert#133433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:mainfromvstinner:test_external_inspection2
May 5, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-133419: fix test_external_inspection race assert
Follow-up of commitc4cc5d5,fix more tests.
  • Loading branch information
@vstinner
vstinner committedMay 5, 2025
commit6dbee3c457b04d6498ab93ae899f6fc4df4c67ab
50 changes: 23 additions & 27 deletionsLib/test/test_external_inspection.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,7 +59,7 @@ def baz():
foo()

def foo():
sock.sendall(b"ready"); time.sleep(1000) # same line number
sock.sendall(b"ready"); time.sleep(10_000) # same line number

bar()
"""
Expand DownExpand Up@@ -121,8 +121,7 @@ def test_async_remote_stack_trace(self):
sock.connect(('localhost', {port}))

def c5():
sock.sendall(b"ready")
time.sleep(10000)
sock.sendall(b"ready"); time.sleep(10_000) # same line number

async def c4():
await asyncio.sleep(0)
Expand DownExpand Up@@ -194,10 +193,10 @@ def new_eager_loop():
root_task = "Task-1"
expected_stack_trace = [
[
("c5", script_name,11),
("c4", script_name,15),
("c3", script_name,18),
("c2", script_name,21),
("c5", script_name,10),
("c4", script_name,14),
("c3", script_name,17),
("c2", script_name,20),
],
"c2_root",
[
Expand All@@ -213,13 +212,13 @@ def new_eager_loop():
taskgroups.__file__,
ANY,
),
("main", script_name,27),
("main", script_name,26),
],
"Task-1",
[],
],
[
[("c1", script_name,24)],
[("c1", script_name,23)],
"sub_main_1",
[
[
Expand All@@ -234,15 +233,15 @@ def new_eager_loop():
taskgroups.__file__,
ANY,
),
("main", script_name,27),
("main", script_name,26),
],
"Task-1",
[],
]
],
],
[
[("c1", script_name,24)],
[("c1", script_name,23)],
"sub_main_2",
[
[
Expand All@@ -257,7 +256,7 @@ def new_eager_loop():
taskgroups.__file__,
ANY,
),
("main", script_name,27),
("main", script_name,26),
],
"Task-1",
[],
Expand DownExpand Up@@ -287,8 +286,7 @@ def test_asyncgen_remote_stack_trace(self):
sock.connect(('localhost', {port}))

async def gen_nested_call():
sock.sendall(b"ready")
time.sleep(10000)
sock.sendall(b"ready"); time.sleep(10_000) # same line number

async def gen():
for num in range(2):
Expand DownExpand Up@@ -336,9 +334,9 @@ async def main():

expected_stack_trace = [
[
("gen_nested_call", script_name,11),
("gen", script_name,17),
("main", script_name,20),
("gen_nested_call", script_name,10),
("gen", script_name,16),
("main", script_name,19),
],
"Task-1",
[],
Expand All@@ -365,8 +363,7 @@ def test_async_gather_remote_stack_trace(self):

async def deep():
await asyncio.sleep(0)
sock.sendall(b"ready")
time.sleep(10000)
sock.sendall(b"ready"); time.sleep(10_000) # same line number

async def c1():
await asyncio.sleep(0)
Expand DownExpand Up@@ -413,9 +410,9 @@ async def main():
stack_trace[2].sort(key=lambda x: x[1])

expected_stack_trace = [
[("deep", script_name,ANY), ("c1", script_name,16)],
[("deep", script_name,11), ("c1", script_name,15)],
"Task-2",
[[[("main", script_name,22)], "Task-1", []]],
[[[("main", script_name,21)], "Task-1", []]],
]
self.assertEqual(stack_trace, expected_stack_trace)

Expand All@@ -439,15 +436,14 @@ def test_async_staggered_race_remote_stack_trace(self):

async def deep():
await asyncio.sleep(0)
sock.sendall(b"ready")
time.sleep(10000)
sock.sendall(b"ready"); time.sleep(10_000) # same line number

async def c1():
await asyncio.sleep(0)
await deep()

async def c2():
await asyncio.sleep(10000)
await asyncio.sleep(10_000)

async def main():
await asyncio.staggered.staggered_race(
Expand DownExpand Up@@ -490,16 +486,16 @@ async def main():
stack_trace[2].sort(key=lambda x: x[1])
expected_stack_trace = [
[
("deep", script_name,ANY),
("c1", script_name,16),
("deep", script_name,11),
("c1", script_name,15),
("staggered_race.<locals>.run_one_coro", staggered.__file__, ANY),
],
"Task-2",
[
[
[
("staggered_race", staggered.__file__, ANY),
("main", script_name,22),
("main", script_name,21),
],
"Task-1",
[],
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp