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

Test collection fails with unknown hook pytest_xdist_auto_run_workers #23774

Open
lukaspiatkowski opened this issue Jul 9, 2024 · 11 comments
Open
Assignees
Labels
area-testing triage-needed Needs assignment to the proper sub-team

Comments

@lukaspiatkowski
Copy link

Type: Bug

I am using pytest-xdist==1.34.0 and I have "python.testing.pytestEnabled" on. Opening Testing tab triggers testing collection which fails. When it first happened I still had the capability to run tests, so I've tried it and the tests also crashed with the same error:

pluggy._manager.PluginValidationError: unknown hook "pytest_xdist_auto_run_workers" in plugin <vscode_pytest.DeferPlugin object at ...>

I've managed to work around this by passing "-p no:xdist" to the pytestArgs, but that is not ideal.

Extension version: 2024.11.2024070901
VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:53:23.353Z)
OS version: Darwin arm64 23.4.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (10 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 13, 9, 7
Memory (System) 16.00GB (0.07GB free)
Process Argv --crash-reporter-id da6a607f-f75f-4468-94ba-7fa2d6b2e8e8
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelc:31048052
dsvsc021:30996838
f3je6385:31013174
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
newcmakeconfigv2:31071590
legacy_priority:31082724

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 9, 2024
@lukaspiatkowski
Copy link
Author

This is most likely a result of #23539, would it be possible to check the version of xdist here? I assume the error is caused by me using an old version of xdist, but I am unable to upgrade it now.

@eleanorjboyd
Copy link
Member

Hi! Saw you closed this- did you upgrade your version and that fixed it?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 9, 2024
@lukaspiatkowski
Copy link
Author

Nope, I just mentioned this issue on a PR that adds the -p no:xdist on a private repository and I've used an unfortunate set of words (temporarily fixing), so GitHub automatically closed this issue after I've merged my PR. But the -p no:xdist seems to be a poor solution, because AFAIU this means running the tests with no parallelization in VSCode, right?

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 9, 2024
@sebmerry
Copy link
Member

sebmerry commented Jul 12, 2024

This broke for me as well in v2024.10.0, I worked around the issue by reverting back to an older version of vscode python extension.

@lukaspiatkowski
Copy link
Author

Any updates here? I was hoping this will make the cut for the next release :)

@eleanorjboyd
Copy link
Member

Hi @lukaspiatkowski, we have just made more changes in this area to help with compatability. Could you give this a try tomorrow on the newest version of the python extension (the pre-release one) that comes out tomorrow and let me know if it works for you?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 22, 2024
@lukaspiatkowski
Copy link
Author

Hi @eleanorjboyd, I have tried the v2024.11.2024072301 Python extension and still have errors. Here are example logs from a single test run. Test discovery itself also fails (traceback here), although it looks like you have implemented some caching mechanism as I can still see tests collected successfully (presumably from past attempts) and failed discovery at the same time (thanks, this functionality is very useful!)
Screenshot 2024-07-23 at 11 10 28

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 23, 2024
@tensoren-likai
Copy link

tensoren-likai commented Jul 23, 2024 via email

@tensoren-likai
Copy link

tensoren-likai commented Jul 23, 2024 via email

@eleanorjboyd
Copy link
Member

Hi @tensoren-likai! I am not see any example logs, could you try sending them again? Thanks

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 24, 2024
@lukaspiatkowski
Copy link
Author

@eleanorjboyd seems like @tensoren-likai send my message repeated by mistake, see my original message above for link to logs

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants