test: ensure tmp directory cleanup in check-emfile-handling.js#19036
test: ensure tmp directory cleanup in check-emfile-handling.js#19036mdjermanovic merged 5 commits intoeslint:mainfrom
check-emfile-handling.js#19036Conversation
✅ Deploy Preview for docs-eslint canceled.
|
|
In CI, this fails on ubuntu with: Looks like |
|
Locally, on Windows, I'm getting a different error: |
|
Interesting. I don't think it's correct for |
|
It's still failing. If we want to remove the directory and the files after the test, perhaps we should wait for all |
|
Couldn't reproduce it locally... I'm not sure if we can robustly wait until file descriptors are freed after |
Even though 8192 retries with default Adding delay helps, I'll try to rewrite it with |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain: cleanup in test
What changes did you make? (Give an overview)
Remove the test directory (
tmp/emfile-check) before and after the test.Before, because it might contain files from previous runs.
ulimitvalues aren't constant, so the actual amount of files might be bigger than the test generates.After, because we shouldn't waste inodes (and space, depending on filesystem) on a directory with potentially 100000+ temp files.
Is there anything you'd like reviewers to focus on?
Noting that there's no cleanup in case of unexpected failure (from
execSync()or evengenerateFiles()), which is intentional for easier manual debugging/reproducing.