Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test_external_inspection fails on Ubuntu #133419

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emmatyping opened this issue May 5, 2025 · 2 comments · Fixed by #133422
Closed

test_external_inspection fails on Ubuntu #133419

emmatyping opened this issue May 5, 2025 · 2 comments · Fixed by #133422
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@emmatyping
Copy link
Member

emmatyping commented May 5, 2025

Bug report

Bug description:

Example: https://github.com/python/cpython/actions/runs/14827808058/job/41623568354?pr=133365

0:12:02 load avg: 6.85 [487/491/3] test_external_inspection failed (3 failures) -- running (2): test.test_concurrent_futures.test_process_pool (1 min 53 sec), test.test_multiprocessing_spawn.test_manager (1 min 10 sec)
test_async_gather_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_gather_remote_stack_trace) ... ok
test_async_global_awaited_by (test.test_external_inspection.TestGetStackTrace.test_async_global_awaited_by) ... ok
test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) ... 
  test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) (task_factory_variant='asyncio.new_event_loop') ... FAIL
  test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) (task_factory_variant='new_eager_loop') ... FAIL
test_async_staggered_race_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_staggered_race_remote_stack_trace) ... ok
test_asyncgen_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_asyncgen_remote_stack_trace) ... ok
test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace) ... FAIL
test_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace) ... ok

======================================================================
FAIL: test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) (task_factory_variant='asyncio.new_event_loop')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_external_inspection.py", line 270, in test_async_remote_stack_trace
    self.assertEqual(stack_trace, expected_stack_trace)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [[('c[62 chars]y', 10), ('c4', '/tmp/test_python_ckrn9tbc/tmp[1269 chars]]]]]] != [[('c[62 chars]y', 11), ('c4', '/tmp/test_python_ckrn9tbc/tmp[1284 chars]]]]]]

First differing element 0:
[('c5[61 chars]y', 10), ('c4', '/tmp/test_python_ckrn9tbc/tmp[179 chars] 21)]
[('c5[61 chars]y', 11), ('c4', '/tmp/test_python_ckrn9tbc/tmp[179 chars] 21)]

Diff is 1984 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) (task_factory_variant='new_eager_loop')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_external_inspection.py", line 270, in test_async_remote_stack_trace
    self.assertEqual(stack_trace, expected_stack_trace)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [[('c[62 chars]y', 10), ('c4', '/tmp/test_python_ckrn9tbc/tmp[1269 chars]]]]]] != [[('c[62 chars]y', 11), ('c4', '/tmp/test_python_ckrn9tbc/tmp[1284 chars]]]]]]

First differing element 0:
[('c5[61 chars]y', 10), ('c4', '/tmp/test_python_ckrn9tbc/tmp[179 chars] 21)]
[('c5[61 chars]y', 11), ('c4', '/tmp/test_python_ckrn9tbc/tmp[179 chars] 21)]

Diff is 1984 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_external_inspection.py", line 104, in test_remote_stack_trace
    self.assertEqual(stack_trace, expected_stack_trace)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [('fo[62 chars]y', 14), ('baz', '/tmp/test_python_ckrn9tbc/tm[186 chars] 17)] != [('fo[62 chars]y', 15), ('baz', '/tmp/test_python_ckrn9tbc/tm[186 chars] 17)]

First differing element 0:
('foo', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 14)
('foo', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 15)

- [('foo', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 14),
?                                                                         ^

+ [('foo', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 15),
?                                                                         ^

   ('baz', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 11),
   ('bar', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 9),
   ('<module>', '/tmp/test_python_ckrn9tbc/tmpf0v2rgso/script_pkg/script.py', 17)]

----------------------------------------------------------------------
Ran 7 tests in 6.071s

FAILED (failures=3)
test test_external_inspection failed

Came across this failure in my PR to add zstd Python code.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@emmatyping emmatyping added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels May 5, 2025
@emmatyping emmatyping changed the title test_external_inspection fails on free-threaded Ubuntu test_external_inspection fails on Ubuntu May 5, 2025
@emmatyping
Copy link
Member Author

Another instance https://github.com/python/cpython/actions/runs/14828458459/job/41625245138?pr=133420, this time only one test failing.

gpshead added a commit that referenced this issue May 5, 2025
[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.
vstinner added a commit to vstinner/cpython that referenced this issue May 5, 2025
vstinner added a commit that referenced this issue May 5, 2025
@vstinner
Copy link
Member

vstinner commented May 5, 2025

It should be fixed by #133433.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants