Skip to content

Do not lower the process listener limit for small checks - #406

Merged
ai merged 2 commits into
ai:mainfrom
deepanshupal:fix/keep-max-listeners
Oct 5, 2026
Merged

ai merged 2 commits into
ai:mainfrom
deepanshupal:fix/keep-max-listeners

Conversation

@deepanshupal

Copy link
Copy Markdown
Contributor

Fixes #405.

calc() called process.setMaxListeners(files + 1). With one input file that sets the limit to 2, below Node's default of 10, so the three SIGINT/SIGTERM listeners that @puppeteer/browsers adds when the time plugin launches Chrome trigger MaxListenersExceededWarning.

The limit now only goes up: it is set only when files + 1 is above the current limit. Multi-file runs behave as before, since scripts/max-listeners-check.sh still passes.

Tests: added test/calc.test.js (the limit stays at 10 for one file, and rises to 21 for 20 files). The first test fails before the change (limit becomes 2) and passes after. Full vitest run passes (26 files, 269 tests) and scripts/max-listeners-check.sh passes.

I could not reproduce the warning end to end with the repo's own time setup, because the Estimo/puppeteer versions in the workspace register fewer listeners than in the report. To check the cause I called calc() for one file and then added three SIGINT and three SIGTERM listeners, like @puppeteer/browsers does: 2 warnings before the change, 0 after.

AI-assisted: written with Claude, and I ran the tests above myself.

deepanshupal and others added 2 commits October 4, 2026 10:25
calc() set the limit to files + 1, which is 2 for a single file. Only raise it.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@ai
ai merged commit 990ce03 into ai:main Oct 5, 2026
3 checks passed
@ai

ai commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thanks.

Do you need a release of this feature soon or we can release it with bigger changes?

@deepanshupal

Copy link
Copy Markdown
Contributor Author

No rush at all - happy for it to ride with the bigger release. Thanks for the quick merge!

@ai

ai commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Released in 14.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One-file CLI time checks emit MaxListenersExceededWarning

2 participants