redhat-developer / redhat-developer/vscode-openshift-tools

"too many files open" while running tests

Open
#3,120 2 comments 0 reactions 1 assignee View on GitHub

@datho7561 is already working on this.

Since Aug 29, 2023.

kind/bug performance
Dominant language
TypeScript
Stars
123
Forks
63
Avg merge
6h 16m
Merged PRs (30d)
74

Description

While trying to develop a test for Component Command execution I'm still running into too many files open error. And I found that actually the problem happens a long before the actual test is executed, see the log output of npm test:

Loading development extension at /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools
[File Watcher (node.js)] Failed to watch /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/user-data/User for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/user-data/User')
[File Watcher (node.js)] Failed to watch /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/user-data/User/settings.json for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/user-data/User/settings.json')
[File Watcher (node.js)] Failed to watch /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/test/fixtures/components/empty.code-workspace for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/test/fixtures/components/empty.code-workspace')
[File Watcher (node.js)] Failed to watch /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/vscode-linux-x64-1.81.1/resources/app/extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/vscode-linux-x64-1.81.1/resources/app/extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json')
[File Watcher (node.js)] Failed to watch /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/vscode-linux-x64-1.81.1/resources/app/extensions/theme-abyss/themes/abyss-color-theme.json for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/vscode-linux-x64-1.81.1/resources/app/extensions/theme-abyss/themes/abyss-color-theme.json')
[vscode.php]: One or more snippets from the extension 'php' very likely confuse snippet-variables and snippet-placeholders (see https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details)
[File Watcher (node.js)] Failed to watch /home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/user-data/User/snippets for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/.vscode-test/user-data/User/snippets')
(node:636849) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `exe --trace-warnings ...` to show where the warning was created)
[636539:0824/013338.891900:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
  odo commands integration component
[636539:0824/013349.566429:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
      1) runCompobentCommand()
  Suite duration: 14.898 s, Tests: 1
  0 passing (20s)
  1 failing
  1) odo commands integration
       component
         runCompobentCommand():
     AssertionError [ERR_ASSERTION]: Start Dev failed:  ✗  too many open files

      at Context.<anonymous> (test/integration-partial/command.test.ts:210:25)
      at Generator.next (<anonymous>)
      at fulfilled (out/test/integration-partial/command.test.js:9:58)

No coverage information was collected, exit without writing coverage information
Error: 1 tests failed
    at Object.<anonymous> (/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/test/integration-partial/index.ts:65:15)
    at Generator.next (<anonymous>)
    at fulfilled (/home/jeremy/projects/vscode-openshift-tools/source/vscode-openshift-tools/out/test/integration-partial/index.js:5:58)
[main 2023-08-23T23:33:57.231Z] Extension host with pid 636849 exited with code: 0, signal: unknown.
Exit code:   1
Failed to run tests

Originally posted by @vrubezhny in https://github.com/redhat-developer/vscode-openshift-tools/issues/2811#issuecomment-1691597323

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.