mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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 <me@aviv.sh> Reviewed-By: Tim Perry <pimterry@gmail.com>
This commit is contained in:
1 parent
279547b7da
commit
5293abff73
1 file changed
+2
-6
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user