Repository navigation
Description
Type: Bug
Behaviour
It looks like test discovery was updated in the most recent Python release and it now breaks for my multi-root, multi-venv project.
When I run discovery, I see a stream of log messages about running the pytest commands and then a lot of messages like:
2023-07-10 14:31:48.395 [info] Using result resolver for discovery
2023-07-10 14:31:48.395 [info] Using result resolver for discovery
2023-07-10 14:31:48.395 [info] Using result resolver for discovery
2023-07-10 14:31:48.438 [error] On data received: Error occurred because the payload UUID is not recognized
2023-07-10 14:31:48.438 [error] On data received: Error occurred because the payload UUID is not recognized
2023-07-10 14:31:48.438 [error] On data received: Error occurred because the payload UUID is not recognized
2023-07-10 14:31:48.680 [info] Test server connected to a client.
2023-07-10 14:31:48.686 [info] Test server connected to a client.
2023-07-10 14:31:48.686 [info] Test server connected to a client.
Once the refresh completes, I'll see only one, sometimes two or my test packages int he explorer and nothing else.
It looks to me like you may have changed how tests are discovered and handled by the new test server (experiment is enabled) and the discovery processes are not communicating back to the thread that's expecting them? Or maybe only the UUID from the last spawned process is tracked so that's the only one that gets discovered?
Expected vs. Actual
Expected: All of my tests to be discovered, displayed, and runnable from the test explorer.
Actual: Only tests from one module show up in test explorer.
Steps to reproduce:
- Create a multi-root workspace (mine has ~40 projects, 2 might be enough to trigger this?) where each project has it's own virtual environment in
<project>/.venvandpython.defaultInterpreterPath: "${workspaceFolder}/.venv/bin/python. - Define pytest tests in each of the projects
- Open the Test Explorer view
- Refresh tests if they are not auto-discovered
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.16
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
- Value of the
python.languageServersetting: Default
Python output included in separate comment. Issue body too long.
Extension version: 2023.12.0
VS Code version: Code 1.80.0 (660393deaaa6d1996740ff4880f1bad43768c814, 2023-07-04T15:06:02.407Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Remote OS version: Linux x64 3.10.0-1160.88.1.el7.x86_64 (test discovery running on this remote)
Remote OS version: Linux x64 4.18.0-425.19.2.el8_7.x86_64
System Info
| Item | Value |
|---|---|
| CPUs | AMD EPYC 7763 64-Core Processor (8 x 2445) |
| GPU Status | 2d_canvas: unavailable_software canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: disabled_software multiple_raster_threads: enabled_on opengl: disabled_off rasterization: disabled_software raw_draw: disabled_off_ok video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: unavailable_software webgl2: unavailable_software webgpu: unavailable_software |
| Load (avg) | undefined |
| Memory (System) | 31.95GB (12.54GB free) |
| Process Argv | --crash-reporter-id 87e5818c-cbab-4d10-bc7f-19efe79b03de |
| Screen Reader | yes |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | SSH: remote.host.com (test discovery running on this remote) |
| OS | Linux x64 3.10.0-1160.88.1.el7.x86_64 |
| CPUs | Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz (4 x 2499) |
| Memory (System) | 30.81GB (17.23GB free) |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | SSH: remote2.host.com |
| OS | Linux x64 4.18.0-425.19.2.el8_7.x86_64 |
| CPUs | Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz (4 x 2500) |
| Memory (System) | 30.75GB (18.92GB free) |
| VM | 0% |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30784847
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
hideindicator:30785051
pythongtdpath:30769146
i26e3531:30780429
pythonnosm12tcf:30779713
pythonidxpt:30784022
pythonnocebcf:30776496
h7j2d465:30786200
Activity
mrburrito commentedon Jul 10, 2023
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)warnings/errors in the three
group1projects about missing venvs are expected; they don't have python code or venvs.User Settings
mrburrito commentedon Jul 10, 2023
Multiroot Workspace config file:
multi-root.code-workspacemrburrito commentedon Jul 10, 2023
Also, I can't seem to turn any of the python experiments off, no matter what I do in the config file(s). Not sure if that's by design or a completely separate bug.
eleanorjboyd commentedon Jul 10, 2023
Hello! Looking into these bugs you reported, I appreciate all your help! In terms of the experiment does
"python.experiments.optOutFrom": ["pythonTestAdapter"],not work for you? Did you reload the window? If that is not working then it is a different issue so let me know. Thanks!mrburrito commentedon Jul 11, 2023
optOutFromworks! Didn't realize that was a thing. Turning off the experiment gets my tests discoverable again, so that's a win. I'll check out the multi-root project on RHEL8 too and comment there if the symlink problem resolves the issue.eleanorjboyd commentedon Jul 11, 2023
Looking into the UUID thing- one issue I have is I have trouble reproing it. Were you able to consistently get the error message
2023-07-10 14:31:48.438 [error] On data received: Error occurred because the payload UUID is not recognized?mrburrito commentedon Jul 11, 2023
Yep. It comes up every time. I'll see if I can put together an example repo I can share, but not 100% I'll be able to do that easily.
mrburrito commentedon Jul 12, 2023
I created a sample repo you can use. When I run this on my Windows VSCode with a Linux Remote over SSH, I get the UUID errors. When I run it on my MacBook, I don't get the UUID errors but I still get the same behavior; only one project's tests show up in the explorer. Not sure why the error messages aren't showing up on the Mac and haven't tried testing locally in Windows. Hopefully this helps you find a solution!
https://github.com/mrburrito/vscode-test-discovery
eleanorjboyd commentedon Jul 12, 2023
Thank you so much for the minimal repro! Much appreciated!
54 remaining items
mrburrito commentedon Dec 19, 2023
Is the symlink fix expected to fully resolve this or is that just a related fix? I think I'm still having this problem even if I open it from the non-symlinked path (which I've been doing because of all the symlink problems!).
eleanorjboyd commentedon Feb 26, 2024
Hello! Symlink bug should be fixed and on vscode insiders! The release to vscode stable will be out by the end of the week. Please let me know if you try it on insiders or stable when it comes out and still doesn't work and I can investigate your specific issue further.
Gordon Shankman (@mrburrito), are you seeing the same error as before, I will circle back!
mrburrito commentedon Feb 26, 2024
I'm no longer on the team that was having the issues. Let me try to get somebody to test it out and get back to you! Looking to see if I can reproduce on a different project as well.
eleanorjboyd commentedon Feb 26, 2024
Thank you, appreciate it!
Merged PR posit-dev/positron-python#213: Merge python extension relea…
Merged PR posit-dev/positron-python#213: Merge python extension relea…
alanwilter commentedon Apr 4, 2024
Sorry for hijacking but #22018 is still not working for me and I can comment there anymore.
eleanorjboyd commentedon Apr 15, 2024
Alan Silva (@alanwilter) I have re-opened the issue so we can discuss there- thanks
eleanorjboyd commentedon Apr 15, 2024
Also closing this issue since we dont have the repro anymore but please create another issue / follow up on #22018 about symlinks so we can discuss any ongoing problems