summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-readfile-pipe-large.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-07-29 02:30:28 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2015-07-29 13:57:14 +0200
commitbc733f70652bd9255287b223dc6cabd64a7659c9 (patch)
tree5175f3ba47fbe99923919da28cab74ffbef446d9 /test/parallel/test-fs-readfile-pipe-large.js
parentd168d01b04cefafcdcb2b88d489d2ed0b7a15154 (diff)
downloadandroid-node-v8-bc733f70652bd9255287b223dc6cabd64a7659c9.tar.gz
android-node-v8-bc733f70652bd9255287b223dc6cabd64a7659c9.tar.bz2
android-node-v8-bc733f70652bd9255287b223dc6cabd64a7659c9.zip
test: fix fs.readFile('/dev/stdin') tests
The tests were creating the temp fixture file in both the parent and the child process, leading to interesting race conditions on the slower buildbots. Rod notes that the tests started failing after putting the build directory on a NFS mount. Fixes: https://github.com/nodejs/io.js/issues/2261 PR-URL: https://github.com/nodejs/io.js/pull/2265 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'test/parallel/test-fs-readfile-pipe-large.js')
-rw-r--r--test/parallel/test-fs-readfile-pipe-large.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-fs-readfile-pipe-large.js b/test/parallel/test-fs-readfile-pipe-large.js
index 66f955a561..99e4bfada8 100644
--- a/test/parallel/test-fs-readfile-pipe-large.js
+++ b/test/parallel/test-fs-readfile-pipe-large.js
@@ -12,11 +12,6 @@ if (process.platform === 'win32') {
var fs = require('fs');
-var filename = path.join(common.tmpDir, '/readfile_pipe_large_test.txt');
-var dataExpected = new Array(1000000).join('a');
-common.refreshTmpDir();
-fs.writeFileSync(filename, dataExpected);
-
if (process.argv[2] === 'child') {
fs.readFile('/dev/stdin', function(er, data) {
if (er) throw er;
@@ -25,6 +20,11 @@ if (process.argv[2] === 'child') {
return;
}
+var filename = path.join(common.tmpDir, '/readfile_pipe_large_test.txt');
+var dataExpected = new Array(1000000).join('a');
+common.refreshTmpDir();
+fs.writeFileSync(filename, dataExpected);
+
var exec = require('child_process').exec;
var f = JSON.stringify(__filename);
var node = JSON.stringify(process.execPath);