Skip to content

Commit

Permalink
test: harden tmpdir/rmdirSync error handling
Browse files Browse the repository at this point in the history
This makes rmdirSync call itself after handling ENOTEMPTY, EEXIST, EPERM
errors instead of directly using fs.rmdirSync to handle the possibility
of such errors repeating on the next try (i.e. FS finished writing new
file just as we are done with our loop to delete all files).

Refs: nodejs#29852
  • Loading branch information
lundibundi committed Nov 17, 2019
1 parent 5c57616 commit cbd30c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/common/tmpdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function rmdirSync(p, originalEr) {
rimrafSync(path.join(p, f));
}
});
fs.rmdirSync(p);
rmdirSync(p, null);
return;
}
throw e;
Expand Down

0 comments on commit cbd30c5

Please sign in to comment.