Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use rm instead of rmdir for recursive operations #390

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

jbudz
Copy link
Member

@jbudz jbudz commented Oct 1, 2021

Starting in Node 16, recursive fs.rmdir calls are deprecated and will log a
warning. It's recommended to use fs.rm intead.

https://nodejs.org/api/deprecations.html#DEP0147

Kibana currently exits on process warnings, this will look like:

  ✓  Step: 'Navigates to details page' succeeded (72 ms)
(node:663222) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)
Node.js process-warning detected:

DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
    at emitRecursiveRmdirWarning (node:internal/fs/utils:816:13)
    at Object.rmdir (node:fs:1115:5)
    at node:internal/util:363:7
    at new Promise (<anonymous>)
    at Object.rmdir [as rmdirAsync] (node:internal/util:349:12)
    at Runner.endJourney (/home/jon/dev/kibana-node-16/node_modules/@elastic/synthetics/src/core/runner.ts:356:11)
    at Runner.runJourney (/home/jon/dev/kibana-node-16/node_modules/@elastic/synthetics/src/core/runner.ts:414:18)
    at runMicrotasks (<anonymous>)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processImmediate (node:internal/timers:437:9)
    at Runner.run (/home/jon/dev/kibana-node-16/node_modules/@elastic/synthetics/src/core/runner.ts:465:11)
    at run (/home/jon/dev/kibana-node-16/node_modules/@elastic/synthetics/src/index.ts:45:12)
    at playwrightStart (/home/jon/dev/kibana-node-16/x-pack/plugins/uptime/e2e/playwright_start.ts:43:15)
    at /home/jon/dev/kibana-node-16/x-pack/plugins/uptime/e2e/playwright_start.ts:19:22
    at /home/jon/dev/kibana-node-16/node_modules/@kbn/test/target_node/functional_test_runner/functional_test_runner.js:48:17
    at FunctionalTestRunner._run (/home/jon/dev/kibana-node-16/node_modules/@kbn/test/target_node/functional_test_runner/functional_test_runner.js:105:14)

Terminating process...
node:child_process:903
    throw err;
    ^

Starting in Node 16, recursive fs.rmdir calls are deprecated and will log a
warning.  It's recommended to use fs.rm intead.

https://nodejs.org/api/deprecations.html#DEP0147
@apmmachine
Copy link

apmmachine commented Oct 1, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-05T15:44:55.497+0000

  • Duration: 16 min 18 sec

  • Commit: 499775c

Test stats 🧪

Test Results
Failed 0
Passed 142
Skipped 0
Total 142

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @jbudz, The changes looks good

Would you be open to changing to fs/promises API instead?

@vigneshshanmugam vigneshshanmugam merged commit 38db447 into elastic:master Oct 5, 2021
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.

3 participants