Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
RaisinTen and aduh95 authored Jun 4, 2021
commit 3e52248434868345192848baa1e5aa918421a3b6
13 changes: 2 additions & 11 deletions test/common/tmpdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ function rmSync(pathname) {
const maxRetries = 10;

for (let retryNumber = 0; retryNumber < maxRetries; ++retryNumber) {
err = null;

try {
fs.rmSync(pathname, { maxRetries: 3, recursive: true, force: true });
return;
} catch (_err) {
err = _err;
}

if (err === null) {
return;
}

const errPath = err.path;
const errCode = err.code;

Expand All @@ -33,11 +28,7 @@ function rmSync(pathname) {
}
}

if (err === null) {
return;
}

throw err;
if (err) throw err;
Comment thread
RaisinTen marked this conversation as resolved.
Outdated
}

const testRoot = process.env.NODE_TEST_DIR ?
Expand Down