Skip to content

Pytest discovery hangs in Remote SSH #25553

Open

Description

@amoschoomy

Type: Bug

Behaviour

Pytest discovery hangs infinitely

Image

Steps to reproduce:

  1. Enter Remote SSH server through Remote Tunneling
  2. Load project in server
  3. Enter pytest discovery

Python Log Output

# Diagnostic data
2025-10-31 08:07:46.111 [info] Experiment 'pythonSurveyNotification' is active
2025-10-31 08:07:47.174 [info] Native locator: Refresh started
2025-10-31 08:07:52.690 [info] > conda info --json
2025-10-31 08:08:01.605 [info] > pyenv which python
2025-10-31 08:08:01.605 [info] cwd: .
2025-10-31 08:08:01.719 [info] Active interpreter [/scratch/project/tcr_ml/gnn_release]:  /scratch/project_mnt/S0163/gnn_env/bin/python
2025-10-31 08:08:01.971 [info] Native locator: Refresh finished in 14797 ms
2025-10-31 08:08:03.224 [info] Starting Pylance language server.
2025-10-31 08:08:17.059 [debug] Testing: Refreshing all test data
2025-10-31 08:08:17.060 [info] Discover tests for workspace name: gnn_release - uri: /scratch/project/tcr_ml/gnn_release
2025-10-31 08:08:17.074 [debug] Starting Test Discovery named pipe
2025-10-31 08:09:43.105 [debug] Testing: Manually triggered test refresh
2025-10-31 08:09:43.105 [debug] Testing: Clearing all discovered tests
2025-10-31 08:09:43.105 [debug] Testing: Forcing test data refresh
2025-10-31 08:09:43.105 [debug] Testing: Refreshing all test data
2025-10-31 08:09:43.105 [info] Discover tests for workspace name: gnn_release - uri: /scratch/project/tcr_ml/gnn_release
2025-10-31 08:09:43.106 [error] Test discovery already in progress, not starting a new one.

Pytest output commandline

(gnn_env) uqachoo1@bun129: gnn_release:$ pytest --collect-only -v
=================================================================================================== test session starts ===================================================================================================
platform linux -- Python 3.11.8, pytest-8.4.2, pluggy-1.6.0 -- /scratch/project_mnt/S0163/gnn_env/bin/python
cachedir: .pytest_cache
rootdir: /scratch/project_mnt/S0163/gnn_release
configfile: pyproject.toml
testpaths: tests
plugins: anyio-4.11.0, mock-3.15.1, xdist-3.8.0, cov-7.0.0
collected 43 items                                                                                                                                                                                                        

<Dir gnn_release>
  <Package tests>
    <Package generate_edge_tests>
      <Module test_api.py>
        <Function test_write_edges_file_for_pdb_success>
        <Function test_write_edges_file_for_pdb_missing>
        <Function test_write_edges_file_for_pdb_invalid_extension>
        <Function test_generate_edges_from_pdb_file_invokes_writer>
        <Function test_generate_edges_from_pdb_dir_uses_executor>
        <Function test_generate_edges_from_tar_creates_archive>
        <Function test_generate_edges_from_tar_keep_expanded>
        <Function test_generate_edges_from_tar_dir>
        <Function test_generate_edges_from_pdb_file_raises_file_not_found>
        <Function test_generate_edges_from_pdb_file_raises_value_error_for_non_pdb>
      <Module test_generate_edge.py>
        <Function test_load_pdb_structure_success>
        <Function test_load_pdb_structure_failure_logs_and_returns_none>
        <Function test_basic_same_chain_and_inclusive_cutoff>
        <Function test_prefers_cb_over_ca>
        <Function test_ca_fallback_when_no_cb>
        <Function test_residues_without_ca_are_ignored>
        <Function test_different_chains_not_compared>
        <Function test_multiple_models_are_independent>
        <Function test_alternate_parser_basic>
        <Function test_edges_text_basic>
        <Function test_edges_text_multiple_pairs_and_order>
      <Module test_io.py>
        <Function test_iter_target_pdbs_filters_by_token_patterns>
        <Function test_load_pdb_structure_success_and_failure>
    <Package generate_graph_tests>
      <Module test_encoding.py>
        <Function test_load_pca_encoding_preserves_single_letter_index>
        <Function test_load_pca_encoding_maps_three_letter_codes>
      <Module test_graph_dataset.py>
        <Function test_raw_and_processed_file_names_normalization>
        <Function test_process_single_txt_and_len_get>
        <Function test_process_tar_gz_multiple_graphs>
      <Module test_io.py>
        <Function test_list_edge_txts_finds_only_txt_files_non_recursive>
        <Function test_list_edge_txts_accepts_str_path>
        <Function test_list_edge_txts_is_case_sensitive_by_default>
        <Function test_parse_edges_basic_spaces_and_tabs>
        <Function test_parse_edges_ignores_blank_and_whitespace_only_lines>
        <Function test_parse_edges_trims_leading_and_trailing_whitespace>
        <Function test_parse_edges_unicode_and_non_ascii_tokens>
        <Function test_parse_edges_empty_file_returns_empty_list>
        <Function test_parse_edges_missing_file_raises>
    <Module test_import.py>
      <Function test_can_import_package>
    <Package utils_tests>
      <Module test_common_utils.py>
        <Function test_is_within_directory_true_and_false>
        <Function test_safe_extract_tar_gz_allows_safe_and_blocks_traversal>
        <Function test_make_archive_calls_subprocess_run>
        <Function test_tmp_root_returns_subdirectory_of_system_temp>
        <Function test_cleanup_uses_shutil_rmtree>

==================================================================================================== warnings summary =====================================================================================================
../gnn_env/lib/python3.11/site-packages/torch_geometric/typing.py:54
  /scratch/project_mnt/S0163/gnn_env/lib/python3.11/site-packages/torch_geometric/typing.py:54: UserWarning: An issue occurred while importing 'pyg-lib'. Disabling its usage. Stacktrace: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /scratch/project_mnt/S0163/gnn_env/lib/python3.11/site-packages/libpyg.so)
    warnings.warn(f"An issue occurred while importing 'pyg-lib'. "

../gnn_env/lib/python3.11/site-packages/torch_geometric/typing.py:110
  /scratch/project_mnt/S0163/gnn_env/lib/python3.11/site-packages/torch_geometric/typing.py:110: UserWarning: An issue occurred while importing 'torch-sparse'. Disabling its usage. Stacktrace: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /scratch/project_mnt/S0163/gnn_env/lib/python3.11/site-packages/libpyg.so)
    warnings.warn(f"An issue occurred while importing 'torch-sparse'. "

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================================================================================== tests coverage ======================================================================================================
_____________________________________________________________________________________ coverage: platform linux, python 3.11.8-final-0 _____________________________________________________________________________________

Name                                         Stmts   Miss  Cover   Missing
--------------------------------------------------------------------------
src/tcrgnn/__init__.py                           8      4    50%   8-12
src/tcrgnn/edge_gen/__init__.py                  0      0   100%
src/tcrgnn/edge_gen/_io.py                      15      8    47%   22, 41-47
src/tcrgnn/edge_gen/api.py                      52     35    33%   52-63, 86-93, 119-127, 143-152, 168-169
src/tcrgnn/edge_gen/cli.py                       0      0   100%
src/tcrgnn/edge_gen/generate_edge.py            58     43    26%   38-44, 75-88, 111-139, 174-178
src/tcrgnn/fold_backend/__init__.py              0      0   100%
src/tcrgnn/graph_gen/__init__.py                 0      0   100%
src/tcrgnn/graph_gen/_io.py                      7      4    43%   18-19, 23-24
src/tcrgnn/graph_gen/api.py                     14     14     0%   1-75
src/tcrgnn/graph_gen/build_graph.py             33     24    27%   22-37, 54-76, 104-105
src/tcrgnn/graph_gen/encodings.py                8      4    50%   55-59
src/tcrgnn/graph_gen/graph_dataset.py           47     28    40%   60-65, 80, 95, 116-149, 160, 176
src/tcrgnn/models/__init__.py                    0      0   100%
src/tcrgnn/models/gatv2.py                      20     20     0%   1-33
src/tcrgnn/plotting/__init__.py                  0      0   100%
src/tcrgnn/plotting/api.py                      14     14     0%   1-22
src/tcrgnn/plotting/charts.py                   35     35     0%   1-52
src/tcrgnn/plotting/io.py                       26     26     0%   1-48
src/tcrgnn/plotting/prepare.py                  11     11     0%   1-20
src/tcrgnn/posthoc_adjustment/__init__.py        0      0   100%
src/tcrgnn/posthoc_adjustment/api.py             0      0   100%
src/tcrgnn/posthoc_adjustment/transform.py     104    104     0%   1-175
src/tcrgnn/training/__init__.py                  0      0   100%
src/tcrgnn/training/config.py                   21      2    90%   14-15
src/tcrgnn/training/data_loading.py             19     19     0%   1-33
src/tcrgnn/training/loop.py                     50     39    22%   25-74
src/tcrgnn/utils/__init__.py                     0      0   100%
src/tcrgnn/utils/_common_utils.py               25     15    40%   19-23, 43-49, 63, 75, 85
src/tcrgnn/utils/_device.py                     11     11     0%   1-16
--------------------------------------------------------------------------
TOTAL                                          578    460    20%
============================================================================================== 43 tests collected in 11.78s ===============================================================================================

Test directory structure

Image

Pyproject toml setup

[project]
name = "tcrgnn"
version = "0.1.0"
description = "GNN TCR Python Package"
authors = [{ name = "Amos Choo", email = "amos.choo@uq.edu.au" }]
dependencies = [
    "torch_geometric==2.5.3",
    "jupyter",
    "matplotlib",
    "seaborn",
    "networkx",
    "biopython",
]
requires-python = ">=3.11"
readme = "README.md"
license = { text = "MIT" }

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"


[tool.pdm]
distribution = true

[tool.ruff]
line-length = 88
target-version = "py311"
exclude = ["old_folders"]

# Enable Ruff formatting (replaces Black)
[tool.ruff.format]
quote-style = "double"       # or "single"
docstring-code-format = true
[tool.ruff.lint]
select = [
    "E",  # pycodestyle errors
    "F",  # pyflakes
    "W",  # warnings
    "I",  # import sorting
    "UP", # pyupgrade
    "B",  # bugbear
    "C4", # comprehensions
]
ignore = [
    "E501", # optionally ignore line length if annoying
]
fixable = ["ALL"]


[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
addopts = [
    "-ra",                       # extra summary
    "--strict-markers",
    "--strict-config",
    "--maxfail=1",
    "--cov=tcrgnn",
    "--cov-report=term-missing",
]

markers = [
    "gpu: tests that require CUDA",
    "slow: long running tests",
    "integration: integration tests that touch disk or multiple modules",
]


[dependency-groups]
dev = [
    "ruff>=0.14.2",
    "pre-commit>=4.3.0",
    "pytest>=8.4.2",
    "pytest-cov>=7.0.0",
    "pytest-xdist>=3.8.0",
    "pytest-mock>=3.15.1",
]

Extension version: 2025.16.0
VS Code version: Code 1.105.1 (7d842fb85a0275a4a8e4d7e040d2625abbf7f084, 2025-10-14T22:33:36.618Z)
OS version: Windows_NT arm64 10.0.26200
Modes:
Remote OS version: Linux x64 4.18.0-553.58.1.el8_10.x86_64

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.11.final.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Installed Extensions
Extension Name Extension Id Version
copilot Git 1.388.0
copilot-chat Git 0.32.4
debugpy ms- 2025.14.1
even-better-toml tam 0.21.2
html-preview-vscode geo 0.2.5
js-debug ms- 1.105.0
jupyter ms- 2025.9.1
jupyter-renderers ms- 1.3.0
python ms- 2025.16.0
rainbow-csv mec 3.23.0
ruff cha 2025.28.0
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-pylance ms- 2025.9.1
vscode-python-envs ms- 1.10.0
System Info
Item Value
CPUs Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU (12 x 2976)
GPU Status 2d_canvas: enabled
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
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: unavailable_software
Load (avg) undefined
Memory (System) 31.57GB (12.29GB free)
Process Argv --crash-reporter-id 2029ef38-5638-40ab-aaa9-1893d0b014ab
Screen Reader no
VM 0%
Item Value
Remote bun133
OS Linux x64 4.18.0-553.58.1.el8_10.x86_64
CPUs AMD EPYC 9454 48-Core Processor (192 x 3799)
Memory (System) 1510.91GB (1426.20GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
aj953862:31281341
nes-set-on:31351930
onetestforazureexp:31335613
6abeh943:31336334
envsactivate1:31353494
gendocstringt:31405074
0574c672:31404437
cloudbuttont:31379625
todos-1:31405332
v66_all_req:31402695
treatment_gpt5applypatchexclusively:31398171
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
applesignin:31399435
dcggh915:31405779
je187915:31407605
afag3459:31405348
ff8f5884:31411053

Activity

  1. eleanorjboyd commented on Nov 5, 2025

    @eleanorjboyd
    Member

    Hi! To confirm, does this work when you run it locally instead of over SSH? This info will help me investigate the following issue- thanks

  2. amoschoomy commented on Nov 10, 2025

    @amoschoomy
    Author

    Yes, I've cloned over the repository locally, and it can discover tests without issues

  3. github-actions commented on Dec 15, 2025

    @github-actions

    Hey Eleanor Boyd (@eleanorjboyd), this issue might need further attention.

    Amos (@amoschoomy), you can help us out by closing this issue if the problem no longer exists, or adding more information.

  4. github-actions commented on Jan 15, 2026

    @github-actions

    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!

  5. added
    bugIssue identified by VS Code Team member as probable bug
    confirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions