PS C:\Work\Others\test-nx\MonoRepo> npm run test
> @mono-repo/source@0.0.0 test
> nx run plugin-a:test --detectOpenHandles
> nx run plugin-a:test --detectOpenHandles
> jest --detectOpenHandles
PASS plugin-a src/generator.spec.ts
generator-a generator
√ should run successfully (656 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 3.723 s
Ran all test suites.
Jest has detected the following 2 open handles potentially keeping Jest from exiting:
● CustomGC
1 | import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
> 2 | import { Tree, readProjectConfiguration } from '@nx/devkit';
| ^
3 |
4 | import { generatorAGenerator } from './generator';
5 | import { GeneratorAGeneratorSchema } from './schema';
at Runtime._loadModule (../../../node_modules/jest-runtime/build/index.js:1018:29)
at Object.<anonymous> (../../../node_modules/nx/src/native/native-bindings.js:66:29)
at Object.<anonymous> (../../../node_modules/nx/src/native/index.js:75:21)
at Object.<anonymous> (../../../node_modules/nx/src/tasks-runner/pseudo-terminal.js:4:18)
at Object.<anonymous> (../../../node_modules/nx/src/command-line/run/run.js:13:27)
at Object.<anonymous> (../../../node_modules/nx/src/devkit-exports.js:31:13)
at Object.<anonymous> (../../../node_modules/@nx/devkit/index.js:17:22)
at Object.<anonymous> (src/generator.spec.ts:2:1)
● PIPEWRAP
at node_modules/get-stdin/index.js (../../../node_modules/prettier/third-party.js:8690:7)
at __require (../../../node_modules/prettier/third-party.js:6:50)
at Object.<anonymous> (../../../node_modules/prettier/third-party.js:8976:13)
at src/config/resolve-config.js (../../../node_modules/prettier/index.js:18407:22)
at __require (../../../node_modules/prettier/index.js:1748:51)
at src/common/get-file-info.js (../../../node_modules/prettier/index.js:18796:19)
at __require (../../../node_modules/prettier/index.js:1748:51)
at Object.<anonymous> (../../../node_modules/prettier/index.js:38172:19)
at ../../../node_modules/@nx/devkit/src/generators/format-files.js:14:55
at async formatFiles (../../../node_modules/@nx/devkit/src/generators/format-files.js:14:20)
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Successfully ran target test for project plugin-a (7s)
With additional flags:
--detectOpenHandles=true
Package Manager Version
NPM: 10.5.0
YARN: 1.22.22
Operating System
[ ] macOS
[ ] Linux
[X] Windows
[ ] Other (Please specify)
Additional Information
We are experiencing issues with the plugins tests after upgrading to NX 19. The tests fails on the CI with some warnings.
The repro repository I've sent is just empty workspace with a react application and a default plugin. When the tests are run with flag --detectOpenHandles, we can see 2 open handles that aren't released.
The plugin actually works and will generate files when called.
Current Behavior
Default tests for plugin should not fails
Expected Behavior
Should not fail or keep handles
GitHub Repo
https://github.com/stephane2024/ReproNX19
Steps to Reproduce
(install dependencies)
create plugin npx nx add @nx/plugin npx nx g @nx/plugin:plugin plugin-a --directory libs/plugins/a npx nx generate @nx/plugin:generator generator-a --directory libs/plugins/a/src
run test npm run test
Generate plugin works fine: npx nx generate @org/plugin-a:generator-a mylib --directory libs/ui/v1
Nx Report
Failure Logs
Package Manager Version
NPM: 10.5.0 YARN: 1.22.22
Operating System
Additional Information
We are experiencing issues with the plugins tests after upgrading to NX 19. The tests fails on the CI with some warnings.
The repro repository I've sent is just empty workspace with a react application and a default plugin. When the tests are run with flag --detectOpenHandles, we can see 2 open handles that aren't released.
The plugin actually works and will generate files when called.
Same issue with NX 19.1.2
Thanks for your help 🙏