Skip to content

Commit b4a10b0

Browse files
committed
fixup! test: clean tmpdir on process exit
1 parent bd99911 commit b4a10b0

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

test/pummel/test-fs-largefile.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,3 @@ assert.strictEqual(readBuf[0], 0);
4747
// Verify that floating point positions do not throw.
4848
fs.writeSync(fd, writeBuf, 0, writeBuf.length, 42.000001);
4949
fs.close(fd, common.mustCall());
50-
51-
// Normally, we don't clean up tmp files at the end of a test, but we'll make an
52-
// exception for a 5 GB file.
53-
process.on('exit', function() {
54-
fs.unlinkSync(filepath);
55-
});

test/pummel/test-fs-watch-file-slow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const fs = require('fs');
2727

2828
const tmpdir = require('../common/tmpdir');
2929

30+
tmpdir.refresh();
3031
const FILENAME = path.join(tmpdir.path, 'watch-me');
3132
const TIMEOUT = 1300;
3233

test/pummel/test-fs-watch-file.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@ const filenameThree = 'charm'; // Because the third time is
4646
const filenameFour = 'get';
4747

4848
process.on('exit', function() {
49-
fs.unlinkSync(filepathOne);
50-
fs.unlinkSync(filepathTwoAbs);
51-
fs.unlinkSync(filenameThree);
52-
fs.unlinkSync(filenameFour);
5349
assert.strictEqual(watchSeenOne, 1);
5450
assert.strictEqual(watchSeenTwo, 2);
5551
assert.strictEqual(watchSeenThree, 1);
5652
assert.strictEqual(watchSeenFour, 1);
5753
});
5854

5955

56+
tmpdir.refresh();
6057
fs.writeFileSync(filepathOne, 'hello');
6158

6259
assert.throws(

test/pummel/test-regress-GH-814.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ function newBuffer(size, value) {
3737
}
3838

3939
const fs = require('fs');
40+
41+
tmpdir.refresh();
4042
const testFileName = require('path').join(tmpdir.path, 'GH-814_testFile.txt');
4143
const testFileFD = fs.openSync(testFileName, 'w');
4244
console.log(testFileName);

test/pummel/test-regress-GH-814_2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const assert = require('assert');
2727

2828
const fs = require('fs');
2929
const tmpdir = require('../common/tmpdir');
30+
31+
tmpdir.refresh();
3032
const testFileName = require('path').join(tmpdir.path, 'GH-814_test.txt');
3133
const testFD = fs.openSync(testFileName, 'w');
3234
console.error(`${testFileName}\n`);

0 commit comments

Comments
 (0)