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

Report errors on discovery more intuitively #22154

Open
eleanorjboyd opened this issue Oct 4, 2023 · 6 comments
Open

Report errors on discovery more intuitively #22154

eleanorjboyd opened this issue Oct 4, 2023 · 6 comments
Assignees
Labels
area-testing feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.

Comments

@eleanorjboyd
Copy link
Member

eleanorjboyd commented Oct 4, 2023

Currently when there is an error during test collection an item is added to the test explorer tree describing an error occurred and to find the reason in the output panel. A few things:

bugs:

  • if you don't reload the window after fixing the error the error node will still exist

feature requests:

image
@eleanorjboyd eleanorjboyd added area-testing needs spike Label for issues that need investigation before they can be worked on. labels Oct 4, 2023
@eleanorjboyd eleanorjboyd self-assigned this Oct 4, 2023
@docktermj
Copy link

Completely agree on need to improve this. I've blown 8 hours on debugging this so far and still haven't figured out what's wrong.

@docktermj
Copy link

I'm on Visual Studio Code 1.83.1 and am seeing this

2023-10-31 14:31:58.447 [info] Experiment 'pythonPromptNewFormatterExt' is active
2023-10-31 14:31:58.447 [info] Experiment 'pythonPromptNewToolsExt' is active
2023-10-31 14:31:58.447 [info] Experiment 'pythonSurveyNotificationcf' is active
2023-10-31 14:31:58.447 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2023-10-31 14:31:58.447 [info] Experiment 'pythonTestAdapter' is active
2023-10-31 14:31:58.447 [info] Test server listening.
2023-10-31 14:31:58.447 [info] Python interpreter path: /bin/python3.10
2023-10-31 14:31:59.793 [info] Starting Pylance language server.
2023-10-31 14:31:59.895 [info] Discover tests for workspace name: undefined - uri: /home/xxxx/.config/Code/User/settings.json
2023-10-31 14:31:59.895 [info] Running discovery for pytest using the new test adapter.
2023-10-31 14:31:59.911 [info] > /bin/python3.10 -m pytest -p vscode_pytest --collect-only tests
2023-10-31 14:31:59.911 [info] cwd: .
2023-10-31 14:32:00.033 [info] Test server connected to a client.
2023-10-31 14:32:00.035 [info] ResultResolver EOT received for discovery.
2023-10-31 14:32:00.053 [error] Subprocess exited unsuccessfully with exit code 4 and signal null.
2023-10-31 14:32:00.054 [error] Subprocess exited unsuccessfully with exit code 4 and signal null. Creating and sending error discovery payload
2023-10-31 14:32:00.054 [error] pytest test discovery error 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 4, Signal: null
2023-10-31 14:32:00.054 [info] ResultResolver EOT received for discovery.
2023-10-31 14:32:00.054 [info] Disposing data receiver for /home/xxxx/senzing.git/g2-sdk-python-next and deleting UUID; pytest discovery.
2023-10-31 14:32:17.970 [info] Discover tests for workspace name: g2-sdk-python-next - uri: /home/xxxx/xxxx.git/g2-sdk-python-next
2023-10-31 14:32:17.970 [info] Running discovery for pytest using the new test adapter.
2023-10-31 14:32:17.999 [info] > /bin/python3.10 -m pytest -p vscode_pytest --collect-only tests
2023-10-31 14:32:17.999 [info] cwd: .
2023-10-31 14:32:18.116 [info] Test server connected to a client.
2023-10-31 14:32:18.117 [info] ResultResolver EOT received for discovery.
2023-10-31 14:32:18.134 [error] Subprocess exited unsuccessfully with exit code 4 and signal null.
2023-10-31 14:32:18.135 [error] Subprocess exited unsuccessfully with exit code 4 and signal null. Creating and sending error discovery payload
2023-10-31 14:32:18.135 [error] pytest test discovery error 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 4, Signal: null
2023-10-31 14:32:18.135 [info] ResultResolver EOT received for discovery.
2023-10-31 14:32:18.135 [info] Disposing data receiver for /home/xxxx/xxxx.git/g2-sdk-python-next and deleting UUID; pytest discovery.

and have no clue what to do next except spend 8 hours searching the web in vain.

@eleanorjboyd
Copy link
Member Author

eleanorjboyd commented Oct 31, 2023

@docktermj if you send over your "python" logs and the logs out of "python test log" in a new issue happy to take a look! (just use the command palette developer: set log levels command to put your logs to Trace).

edit: just saw your message, please change log level and resend. The error will also likely be in "python test log".

@docktermj
Copy link

I found the fix. In settings.json:

 "python.experiments.optOutFrom": [
        "pythonTestAdapter"
    ],

But I gotta' admit, wasn't easy to figure this out.

@eleanorjboyd
Copy link
Member Author

Hello @docktermj, glad you figured out a work around. Where were you initially looking that you think could better surface that setting so it would have been easier to find? Also would you be able to send your logs from before? We will be switching over to only using the rewrite and removing the opt-out options and I would love to understand / fix your bug so you don't face problems in the future. Thanks!

@PterX
Copy link

PterX commented Apr 4, 2024

I found the fix. In settings.json:

 "python.experiments.optOutFrom": [
        "pythonTestAdapter"
    ],

But I gotta' admit, wasn't easy to figure this out.

I have same issue

@karthiknadig karthiknadig added the feature-request Request for new features or functionality label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.
Projects
None yet
Development

No branches or pull requests

4 participants