-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to run tests with pythonTestAdapter
enabled
#22250
Comments
For anyone else who encounters this, the workaround suggested here to disable the test adapter resolves the issue for me. |
Hi! Do you have any settings to disable port forwarding or something like that? We use ports to communicate between the pytest run and our extension and it seems that could be the issue with |
@eleanorjboyd nope, I have auto forward ports still enabled and the auto forward port source setting on the default value |
Anything on your machine for settings? @karthiknadig any other ideas why it would be blocking the connect in this case? |
@heidimhurst Are you in a remote or WSL or devcontainer scenario? Would it be possible to share the full logs. I only see the tesdid server not the main server in the logs. |
Hi @karthiknadig - nope, just straight local development. I've tried with and without my VPN on, am not aware of anything else that might be blocking the connection Output > Python Logs (Trace)
Output > Python Test Logs (Trace)
I'm happy to provide more logs if you point me to what specifically you'd like |
Let me see if I can put in more in-depth error messaging to check if we got the right env var value to the subprocess that contains the port number. Ill reach out when I have a PR merged. Thanks!! |
May be of some help: I have been experiencing this exact same bug as well with the caveat being that it only occurs when connected to a VPN. |
I seem to have a variation of this, where VSCode instantly states "Finished running tests!" but doesn't do anything, this is when it has been ran from within a dev container. |
@jcampbell05 and @danleesmith could you both send logs for the "python output logs" and "python" logs? Specifically with debugging set to trace. @heidimhurst it is interesting because from your logs it is clear that there is a socket opened and the environment variable that passes the port number to the subprocess works correctly since you do not have the error message about a null value for the port variable. I can also see from your logs the server is started correctly here |
I'm not familiar with how to enable this option but I can certainly get you the logs. |
Sorry for the confusion, I was moving too fast as I typed out my response. I had meant the log level set to trace. You can do so by going to the command palette and looking for |
Python Logs 2023-10-25 10:34:44.110 [debug] Firing data received event, {"command_type": "discovery", "eot": true}
2023-10-25 10:34:44.110 [info] ResultResolver EOT received for discovery.
2023-10-25 10:34:45.802 [debug] deferredTill EOT resolved
2023-10-25 10:34:45.802 [info] Disposing data receiver for /workspace and deleting UUID; pytest discovery.
2023-10-25 10:34:48.464 [debug] Testing: Resolving item /var/task
2023-10-25 10:34:48.465 [debug] Testing: Resolving item /var/task/src
2023-10-25 10:34:48.465 [debug] Testing: Resolving item /var/task/src/__tests__
2023-10-25 10:34:48.465 [debug] Testing: Resolving item /var/task/src/__tests__/test_api.py
2023-10-25 10:34:59.572 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-10-25 10:34:59.575 [debug] Found cached env for /usr/local/bin/python
2023-10-25 10:34:59.575 [debug] Resolved /usr/local/bin/python from cache: {"name":"","location":"","kind":"global-other","executable":{"filename":"/usr/local/bin/python","sysPrefix":"/usr/local","ctime":1697108118683,"mtime":1697074493000},"display":"Python 3.11.6 64-bit","version":{"major":3,"minor":11,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.11.6 (main, Oct 12 2023, 01:32:10) [GCC 12.2.0]"},"arch":3,"distro":{"org":""},"source":[],"id":"/usr/local/bin/python","detailedDisplayName":"Python 3.11.6 64-bit"}
2023-10-25 10:34:59.618 [debug] Clearing context for python dependencies not installed: /workspace/v3/src/images/admin.py
2023-10-25 10:35:02.063 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-10-25 10:35:02.063 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-10-25 10:35:02.063 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2023-10-25 10:35:02.063 [debug] Found cached env for /usr/local/bin/python
2023-10-25 10:35:02.064 [debug] Found cached env for /usr/local/bin/python
2023-10-25 10:35:02.064 [debug] Resolved /usr/local/bin/python from cache: {"name":"","location":"","kind":"global-other","executable":{"filename":"/usr/local/bin/python","sysPrefix":"/usr/local","ctime":1697108118683,"mtime":1697074493000},"display":"Python 3.11.6 64-bit","version":{"major":3,"minor":11,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.11.6 (main, Oct 12 2023, 01:32:10) [GCC 12.2.0]"},"arch":3,"distro":{"org":""},"source":[],"id":"/usr/local/bin/python","detailedDisplayName":"Python 3.11.6 64-bit"}
2023-10-25 10:35:02.064 [debug] Resolved /usr/local/bin/python from cache: {"name":"","location":"","kind":"global-other","executable":{"filename":"/usr/local/bin/python","sysPrefix":"/usr/local","ctime":1697108118683,"mtime":1697074493000},"display":"Python 3.11.6 64-bit","version":{"major":3,"minor":11,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.11.6 (main, Oct 12 2023, 01:32:10) [GCC 12.2.0]"},"arch":3,"distro":{"org":""},"source":[],"id":"/usr/local/bin/python","detailedDisplayName":"Python 3.11.6 64-bit"}
2023-10-25 10:35:02.064 [debug] Cached data exists KeyPrefix=Cache_Method_Output_E.ensureEnvironmentContainsPython-Args="/usr/local/bin/python"-Arg-Separator-undefined
2023-10-25 10:35:02.111 [debug] Clearing context for python dependencies not installed: ms-python.python.Python I don't appear to have "Python Output logs" only the logs for python in the output tab. |
I'm having some variant of the issue. When not opting out of |
hi @tazle, could you make sure your log level is set to trace then see if you can see this message in your logs "All environment variables set for pytest execution in /Users/eleanorboyd/testingFiles/inc_dec_example workspace: "? You can set your log level through the command palette by going to "developer: set log level". Check to see if the |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. Happy Coding! |
Type: Bug
Behaviour
Expected vs. Actual
Tests are currently not running for me using the python testing plugin as previous. When I run a test by clicking the GUI arrow in the test pane, the test hangs indefinitely. In the Python Test Log, I get the following error:
This only happens when I set
"python.experiments.optInto": ["pythonTestAdapter"]
in mysettings.json
file; if I explicitly opt out of that experiment, this issue does not recur.I am able to run tests in the terminal in the same environment (conda) using
pytest
directly without issue.Steps to reproduce:
pythonTestAdapter
via"python.experiments.optInto": ["pythonTestAdapter"]
insettings.json
.Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.18.0
VS Code version: Code 1.82.3 (fdb98833154679dbaa7af67a5a29fe19e55c2b73, 2023-10-02T11:06:17.496Z)
OS version: Darwin x64 23.0.0
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: