From e24dede403e964103da014d9ef83cf2fa5c9246b Mon Sep 17 00:00:00 2001 From: Livia Medeiros Date: Sun, 29 Jun 2025 05:31:56 +0800 Subject: [PATCH] test: close dirs in `fs-opendir` test PR-URL: https://github.com/nodejs/node/pull/58855 Reviewed-By: Luigi Pinca Reviewed-By: Antoine du Hamel --- test/parallel/test-fs-opendir.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-fs-opendir.js b/test/parallel/test-fs-opendir.js index fe808e3d2c4..30ad440b9bb 100644 --- a/test/parallel/test-fs-opendir.js +++ b/test/parallel/test-fs-opendir.js @@ -230,6 +230,7 @@ for (const bufferSize of ['', '1', null]) { async function doAsyncIterInvalidCallbackTest() { const dir = await fs.promises.opendir(testDir); assert.throws(() => dir.close('not function'), invalidCallbackObj); + dir.close(); } doAsyncIterInvalidCallbackTest().then(common.mustCall()); @@ -258,6 +259,7 @@ doConcurrentAsyncAndSyncOps().then(common.mustCall()); { const dir = fs.opendirSync(testDir); assert.throws(() => dir.read('INVALID_CALLBACK'), /ERR_INVALID_ARG_TYPE/); + dir.close(); } // Check that concurrent read() operations don't do weird things.