Skip to content
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

Show segfault information if a test fails #22090

Closed
connor4312 opened this issue Sep 26, 2023 · 6 comments
Closed

Show segfault information if a test fails #22090

connor4312 opened this issue Sep 26, 2023 · 6 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug

Comments

@connor4312
Copy link
Member

Testing #21092

If I manually run a test via pytest . on the command line which has a segfault, I get a traceback of the current thread. However, I don't see such output in the Test Results view.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 26, 2023
@eleanorjboyd
Copy link
Member

eleanorjboyd commented Sep 27, 2023

In the TPI you were testing it via unittest and you tried it via pytest in the command line. Could you try it instead via unittest in the command line and see what the output difference is? Thanks!

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Sep 27, 2023
@connor4312
Copy link
Member Author

I somehow linked the wrong issue, it was actually #22080

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Sep 27, 2023
@eleanorjboyd
Copy link
Member

If you look in the "python test logs" channel does the traceback appear there? I think what is happening is the subprocesses which runs pytest errors because of the seg fault. Then there is still an output with the stack trace but instead of pytest being able to capture this (because it errored and exited) it instead just dumps it to stdout. Stdout at this point still goes to "python test logs" since I haven't switched over to using the "test result" panel for output yet. So I think this is desired behavior as of now but it will soon be printed to the test result panel.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Sep 28, 2023
@connor4312
Copy link
Member Author

Yep, here's the output:

CLIENT: Server listening on port 45711...
Received JSON data in run script
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite
collected 1 item

test_many_functions.py Fatal Python error: Segmentation fault

Current thread 0x00007f9fa8dd2000 (most recent call first):
  File "/usr/lib/python3.10/ctypes/__init__.py", line 517 in string_at
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/test_many_functions.py", line 7 in test_many_1p
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/python.py", line 194 in pytest_pyfunc_call
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/python.py", line 1792 in runtest
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 169 in pytest_runtest_call
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 262 in <lambda>
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 341 in from_call
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 261 in call_runtest_hook
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 222 in call_and_report
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 133 in runtestprotocol
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/main.py", line 350 in pytest_runtestloop
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/main.py", line 325 in _main
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/main.py", line 271 in wrap_session
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/main.py", line 318 in pytest_cmdline_main
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/home/connor/Documents/inc_dec_example_repo/inc_dec_example_test_suite/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 169 in main
  File "/home/connor/.vscode-insiders/extensions/ms-python.python-2023.17.12691017/pythonFiles/vscode_pytest/run_pytest_script.py", line 67 in <module>

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Sep 28, 2023
@eleanorjboyd
Copy link
Member

sweet thanks, Im going to leave this open then pending the change to output tracked here: #21861

@eleanorjboyd eleanorjboyd added bug Issue identified by VS Code Team member as probable bug area-testing and removed triage-needed Needs assignment to the proper sub-team labels Sep 28, 2023
@luabud luabud added the needs PR Ready to be worked on label Dec 19, 2023
@eleanorjboyd
Copy link
Member

Tried this again, the traceback of the current thread is in the test result panel!

@github-actions github-actions bot removed the needs PR Ready to be worked on label Dec 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants