Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: rename regression tests with descriptive file names (pt. 7) #19668

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -21,11 +21,15 @@

'use strict';
const common = require('../common');
const tmpdir = require('../common/tmpdir');

// This test ensures that `fs.truncate` opens the file with `r+` and not `w`,
// which had earlier resulted in the target file's content getting zeroed out.
// https://github.com/nodejs/node-v0.x-archive/issues/6233

const assert = require('assert');
const fs = require('fs');

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

const filename = `${tmpdir.path}/truncate-file.txt`;

tmpdir.refresh();
Expand All @@ -42,8 +46,12 @@ tmpdir.refresh();
{
fs.writeFileSync(filename, '0123456789');
assert.strictEqual(fs.readFileSync(filename).toString(), '0123456789');
fs.truncate(filename, 5, common.mustCall(function(err) {
assert.ifError(err);
assert.strictEqual(fs.readFileSync(filename).toString(), '01234');
}));
fs.truncate(
filename,
5,
common.mustCall(function(err) {
assert.ifError(err);
assert.strictEqual(fs.readFileSync(filename).toString(), '01234');
})
);
}
7 changes: 0 additions & 7 deletions test/parallel/test-process-exit-GH-12322.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/parallel/test-process-exit-flaky-handler.js
@@ -0,0 +1,11 @@
'use strict';
require('../common');

// This test ensures that no asynchronous operations are performed in the 'exit'
// handler.
// https://github.com/nodejs/node/issues/12322

process.on('exit', () => {
setTimeout(process.abort, 0); // Should not run.
for (const start = Date.now(); Date.now() - start < 10;);
});