From 5293abff73d6cbee3c58170bfd39b60e8c3f1818 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Thu, 30 Jul 2026 21:11:37 -0700 Subject: [PATCH] vfs: speed up recursive readdir test setup Create the deep directory tree with one recursive mkdirSync() call. This avoids repeatedly resolving increasingly long paths and prevents timeouts on slower CI hosts. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol PR-URL: https://github.com/nodejs/node/pull/64813 Refs: https://github.com/nodejs/reliability/issues?q=sort%3Aupdated-desc%20%22test-vfs-readdir-symlink-recursive%22 Reviewed-By: Aviv Keller Reviewed-By: Tim Perry --- test/parallel/test-vfs-readdir-symlink-recursive.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-vfs-readdir-symlink-recursive.js b/test/parallel/test-vfs-readdir-symlink-recursive.js index f46a12da7b9..ce0538ec1ca 100644 --- a/test/parallel/test-vfs-readdir-symlink-recursive.js +++ b/test/parallel/test-vfs-readdir-symlink-recursive.js @@ -114,12 +114,8 @@ assert.ok( const v = vfs.create(); // Build /deep/0/1/2/.../999/leaf.txt - let path = '/deep'; - v.mkdirSync(path); - for (let i = 0; i < DEPTH; i++) { - path += `/${i}`; - v.mkdirSync(path); - } + const path = `/deep/${Array.from({ length: DEPTH }, (_, i) => i).join('/')}`; + v.mkdirSync(path, { recursive: true }); v.writeFileSync(`${path}/leaf.txt`, 'deep'); const entries = v.readdirSync('/deep', { recursive: true });