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

monorepo multiple pytests used to discover fine. now hangs forever. #22874

Closed
Jackbennett opened this issue Feb 7, 2024 · 6 comments
Closed
Assignees
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@Jackbennett
Copy link

Jackbennett commented Feb 7, 2024

Type: Bug

Behaviour

Discover multiple trees of tests.

Expected vs. Actual

Expected all the tests from multiple listed locations in a tree, instead we hang forever

Steps to reproduce:

// .vscode/settings.json
{
"python.testing.pytestArgs": [
        "${workspaceFolder}/packages/lib/tests",
        "${workspaceFolder}/packages/api/tests",
    ],
}

If I comment out either path, the tests get discovered. with both the output lists the test function and hangs. This used to work, like a long time ago, I just never made an issue. Possibly before the new discovery adapter, I think I used to have a setting to use the old mechanism, but obviously that's now been removed.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.6
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): venv & pdm
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2024-02-07 16:30:32.600 [info] > ./.venv/bin/python -m pytest -p vscode_pytest --collect-only ./packages/lib/tests ./packages/api/tests
2024-02-07 16:30:32.600 [info] cwd: .
2024-02-07 16:30:35.002 [info] ============================= test session starts ==============================
platform linux -- Python 3.11.6, pytest-7.4.4, pluggy-1.3.0

2024-02-07 16:30:35.016 [info] rootdir: /workspace/persist/mine/packages/lib
configfile: pyproject.toml
plugins: cov-4.1.0

2024-02-07 16:30:35.045 [info] collected 28 items

<Module tests/test_data.py>
  <Function test_import_a>
  <Function test_import_b>
<Module tests/test_data_items.py>
  <Function Redacted...>
<Module test_main.py>
  <Function test_demo>



that's it, we hang there forever. the UI never updates.

User Settings


languageServer: "Pylance"

    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.pytestArgs": [
        "${workspaceFolder}/packages/lib/tests",
        "${workspaceFolder}/packages/api/tests",
    ],

Extension version: 2024.0.1
VS Code version: Code 1.86.0 (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T10:28:19.990Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.1.61-talos
Remote OS version: Linux x64 6.1.61-talos
Connection to 'SSH: linux1' could not be established Canceled

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-11300H @ 3.10GHz (8 x 2611)
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.74GB (12.09GB free)
Process Argv --crash-reporter-id 4b5a9443-6f83-4363-bd07-6c536f845542
Screen Reader no
VM 0%
Item Value
Remote SSH: dev
OS Linux x64 6.1.61-talos
CPUs Intel(R) Xeon(R) Gold 6244 CPU @ 3.60GHz (4 x 3591)
Memory (System) 23.45GB (16.15GB free)
VM 0%
Item Value
Remote SSH: dev
OS Linux x64 6.1.61-talos
CPUs Intel(R) Xeon(R) Gold 6244 CPU @ 3.60GHz (4 x 3591)
Memory (System) 23.45GB (16.15GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30951796
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementst:30887150
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
bf62j303:30959262
dsvsc019b:30953937
b5d27386:30958190
3ef8e399:30949928
bg6jg535:30958357

@github-actions github-actions bot added triage-needed Needs assignment to the proper sub-team info-needed Issue requires more information from poster labels Feb 7, 2024
@eleanorjboyd
Copy link
Member

Hi! Spoke with my team and need to investigate this more.

(Ignore my previous deleted message as I understand the scenario/setup now)

@Jackbennett
Copy link
Author

I wondered if it's something to do with the rootDir looking at lib but in the test discovery output <Module test_main.py> <Function test_demo> would be from package/api/tests/test_main.py:test_demo which is actually just assert true as I tried to get to the bottom of the hang.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 8, 2024
@eleanorjboyd
Copy link
Member

Hi @Jackbennett, sorry for the delay!! Wanted to follow up and see if there was any progress here. If not, could you please send me a minimal repro of your setup? What I am mostly concerned about is the pyproject.toml and rootdir as seen below since these could be causing the path or location of pytest's search to be disrupted:

2024-02-07 16:30:35.016 [info] rootdir: /workspace/persist/mine/packages/lib
configfile: pyproject.toml

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Apr 25, 2024
@eleanorjboyd
Copy link
Member

Hello! I am closing this issue since we have not heard back on the above question, please comment with the requested information if you are still experiencing this problem and I can re-open it. Thanks

@eleanorjboyd eleanorjboyd closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
@Jackbennett
Copy link
Author

Jackbennett commented Jun 9, 2024

I recreated the setup and an example repo but I'm now* getting the expected tests found. Perhaps I hand an error, perhaps something in this time past fixed it.

Awful typo.

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

Hi! Could you send an example repro of your project so I can try it on my machine?

@eleanorjboyd eleanorjboyd reopened this Jun 10, 2024
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jun 10, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants