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

[Bug]: Latest version of cdms2=3.1.5 with MPI build of esmf>=8.4.0/esmpy>=8.4.0 breaks VS Code's Testing API with [WARNING]: yaksa: #737

Closed
tomvothecoder opened this issue Oct 2, 2023 · 1 comment
Assignees
Labels
bug Bug fix (will increment patch version) cdat-migration-fy24 CDAT Migration FY24 Task

Comments

@tomvothecoder
Copy link
Collaborator

tomvothecoder commented Oct 2, 2023

Overview

Since cdms2 was patched with esmpy>=8.4.0 (includes esmf>=8.4.0), I have not been able to use VS Code's Testing API to write tests for e3sm_diags. When VS Code attempts to discover pytest unit tests, the [WARNING]: yaksa: 10 leaked handle pool object is raised immediately which VS Code interprets as an error.

It seems like this warning is related to MPI/MPICH and something in the MPI build of ESMF. I don't see any GitHub issue in the ESMF/esmpy repo about this, but did find these issues from other repos:

This issue is mostly an annoyance because it hinders my ability to write and debug unit tests efficiently.

VS Code Output

2023-10-02 15:22:27.186 [info] Discover tests for workspace name: e3sm_diags - uri: /Users/vo13/Documents/Repositories/E3SM-Project/e3sm_diags
2023-10-02 15:22:27.192 [info] > conda run -n e3sm_diags_dev_658 --no-capture-output python ~/.vscode/extensions/ms-python.python-2023.16.0/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2023.16.0/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear --no-cov
2023-10-02 15:22:27.194 [info] cwd: .
2023-10-02 15:22:38.508 [error] Error discovering pytest tests:
 [n [Error]: [WARNING] yaksa: 10 leaked handle pool objects

	at ChildProcess.<anonymous> (/Users/vo13/.vscode/extensions/ms-python.python-2023.16.0/out/client/extension.js:2:241274)
	at Object.onceWrapper (node:events:628:26)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1091:16)
	at Socket.<anonymous> (node:internal/child_process:449:11)
	at Socket.emit (node:events:513:28)
	at Pipe.<anonymous> (node:net:322:12)]

Minimum Reproducible Example

I created dummy Python repo with just cdms2, esmpy (MPI build), and pytest in mamba env. I created some dummy Python files and a test file with a single unit test.

I tried to discover tests with VS Code but reproduced the same yaksa error.

2023-10-02 15:25:47.506 [info] Discover tests for workspace name: vscode-esmf - uri: /Users/vo13/Documents/Repositories/E3SM-Project/vscode-esmf
2023-10-02 15:25:47.515 [info] > conda run -n vscode-esmf --no-capture-output python ~/.vscode/extensions/ms-python.python-2023.16.0/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2023.16.0/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear --no-cov
2023-10-02 15:25:47.515 [info] cwd: .
2023-10-02 15:25:49.262 [error] Error discovering pytest tests:
 [n [Error]: [WARNING] yaksa: 10 leaked handle pool objects

	at ChildProcess.<anonymous> (/Users/vo13/.vscode/extensions/ms-python.python-2023.16.0/out/client/extension.js:2:241274)
	at Object.onceWrapper (node:events:628:26)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1091:16)
	at ChildProcess._handle.onexit (node:internal/child_process:302:5)]

Possible Solutions

  1. Suppress C level warning for yaksa? -- is this possible and why is this error even being raised?
  2. Maybe open up an issue with esmf/esmpy/MPICH repo?

Workarounds

  1. Install the no MPI build of esmf (esmf >=8.4.0 nompi*) in the e3sm_diags dev env -- validated this works by using this yaml file
  2. Run pytest . via CLI while writing tests -- not my preferred method

Additional Context

There is a similar issue with the yaksa warning in xCDAT. However, VS Code's testing API works fine with xCDAT and the latest version of xESMF/esmpy because that warning is raised AFTER regridding tests are executed and not during the test discover phase.

@tomvothecoder tomvothecoder added bug Bug fix (will increment patch version) cdat-migration-fy24 CDAT Migration FY24 Task labels Oct 2, 2023
@tomvothecoder tomvothecoder self-assigned this Oct 2, 2023
@tomvothecoder tomvothecoder changed the title [Bug]: Latest import of cdms2=3.1.5 with esmpy>=8.4.0 breaks VS Code's Testing API [Bug]: Latest import of cdms2=3.1.5 with esmpy>=8.4.0 breaks VS Code's Testing API with [WARNING]: yaksa: 10 leaked handle pool object Oct 2, 2023
@tomvothecoder tomvothecoder changed the title [Bug]: Latest import of cdms2=3.1.5 with esmpy>=8.4.0 breaks VS Code's Testing API with [WARNING]: yaksa: 10 leaked handle pool object [Bug]: Latest version of cdms2=3.1.5 with MPI version of esmf>=8.4.0 and esmpy>=8.4.0 breaks VS Code's Testing API with yaksa warning Oct 3, 2023
@tomvothecoder tomvothecoder changed the title [Bug]: Latest version of cdms2=3.1.5 with MPI version of esmf>=8.4.0 and esmpy>=8.4.0 breaks VS Code's Testing API with yaksa warning [Bug]: Latest version of cdms2=3.1.5 with MPI version of esmf>=8.4.0/esmpy>=8.4.0 breaks VS Code's Testing API with yaksa warning Oct 3, 2023
@tomvothecoder tomvothecoder changed the title [Bug]: Latest version of cdms2=3.1.5 with MPI version of esmf>=8.4.0/esmpy>=8.4.0 breaks VS Code's Testing API with yaksa warning [Bug]: Latest version of cdms2=3.1.5 with MPI build of esmf>=8.4.0/esmpy>=8.4.0 breaks VS Code's Testing API with yaksa warning Oct 3, 2023
@tomvothecoder tomvothecoder changed the title [Bug]: Latest version of cdms2=3.1.5 with MPI build of esmf>=8.4.0/esmpy>=8.4.0 breaks VS Code's Testing API with yaksa warning [Bug]: Latest version of cdms2=3.1.5 with MPI build of esmf>=8.4.0/esmpy>=8.4.0 breaks VS Code's Testing API with [WARNING]: yaksa: Oct 3, 2023
@tomvothecoder tomvothecoder removed this from the FY24 Q1 (10/1/23 to 12/31/23) milestone Oct 10, 2023
@tomvothecoder
Copy link
Collaborator Author

I don't think this happens anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix (will increment patch version) cdat-migration-fy24 CDAT Migration FY24 Task
Projects
None yet
Development

No branches or pull requests

1 participant