aws / aws/aws-toolkit-vscode

tests: "ENOSPC: System limit for number of file watchers reached"

Open
#3,815 1 comment 0 reactions 0 assignees View on GitHub
tests-ci-cd
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

# Problem

Linux unit tests sometimes fail:

```
1) WinstonToolkitLogger
logs to a file
does not log a lower level:
Error: ENOSPC: System limit for number of file watchers reached, watch '/tmp/aws-toolkit-vscode/vsctkxDXHCi'
at FSWatcher. (node:internal/fs/watchers:244:19)
at Object.watch (node:fs:2247:34)
at /codebuild/output/src3581993545/src/github.com/aws/aws-toolkit-vscode/src/test/shared/logger/winstonToolkitLogger.test.ts:27:28
at new Promise ()
at /codebuild/output/src3581993545/src/github.com/aws/aws-toolkit-vscode/src/test/shared/logger/winstonToolkitLogger.test.ts:26:19
```

# Proposal

- Eliminate `createLogWatcher` https://github.com/aws/aws-toolkit-vscode/blob/e7116952ab3503199420f30ce8656e07d8b36ad0/src/shared/logger/activation.ts#L168
- it only shows a message, no other functional purpose
- ![image](https://github.com/aws/aws-toolkit-vscode/assets/55561878/1ab76df1-a0f8-4a7e-b01a-c6b77000afff)
- if the log file is deleted, Toolkit continues to work correctly, and logs to the vscode output channel
- Revert https://github.com/aws/aws-toolkit-vscode/commit/9e380d1baa4aed5598c1ce3a1c895854726dab3f

Contributor guide

Open the contributing guide

Research direction

Start with src/test/shared/logger/winstonToolkitLogger.test.ts, where the Linux ENOSPC failure occurs, and inspect createLogWatcher in src/shared/logger/activation.ts. Check the referenced commit and verify that the unit test no longer reaches the file-watcher limit while logging behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.