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

[v10.x backport] test: refactor common.ddCommand() #23630

Closed
wants to merge 16 commits into from
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
test: rename common.ddCommand()
Change common.ddCommand() to common.createZeroFilledFile().

PR-URL: #23411
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
Trott committed Oct 13, 2018
commit ea510a681ea2d24a066effcb5106129a994e0882
2 changes: 1 addition & 1 deletion test/common/README.md
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ symlinks
([SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)).
On non-Windows platforms, this always returns `true`.

### ddCommand(filename)
### createZeroFilledFile(filename)

Creates a 10 MB file of all null characters.

4 changes: 2 additions & 2 deletions test/common/index.js
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ function childShouldThrowAndAbort() {
});
}

function ddCommand(filename) {
function createZeroFilledFile(filename) {
const fd = fs.openSync(filename, 'w');
fs.ftruncateSync(fd, 10 * 1024 * 1024);
fs.closeSync(fd);
@@ -696,7 +696,7 @@ module.exports = {
busyLoop,
canCreateSymLink,
childShouldThrowAndAbort,
ddCommand,
createZeroFilledFile,
disableCrashOnUnhandledRejection,
enoughTestCpu,
enoughTestMem,
4 changes: 2 additions & 2 deletions test/common/index.mjs
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ const {
PIPE,
hasIPv6,
childShouldThrowAndAbort,
ddCommand,
createZeroFilledFile,
platformTimeout,
allowGlobals,
mustCall,
@@ -71,7 +71,7 @@ export {
PIPE,
hasIPv6,
childShouldThrowAndAbort,
ddCommand,
createZeroFilledFile,
platformTimeout,
allowGlobals,
mustCall,
2 changes: 1 addition & 1 deletion test/parallel/test-http-chunk-problem.js
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ function executeRequest(cb) {

tmpdir.refresh();

common.ddCommand(filename);
common.createZeroFilledFile(filename);

server = http.createServer(function(req, res) {
res.writeHead(200);
2 changes: 1 addition & 1 deletion test/parallel/test-pipe-file-to-http.js
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ const server = http.createServer(function(req, res) {
server.listen(0);

server.on('listening', function() {
common.ddCommand(filename);
common.createZeroFilledFile(filename);
makeRequest();
});