From 5813a912447226f52b17c716803c7ea2b6bebebf Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 17 Jun 2015 22:08:43 +0100 Subject: [PATCH] adjust timing on file tail test Runs cleaner on Mac --- Dockerfile | 2 ++ npm-debug.log | 20 ++++++++++++++++++++ test/nodes/core/storage/28-tail_spec.js | 7 +++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 npm-debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..10652ae6d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM node:0.10-onbuild +EXPOSE 1880 diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..3a7a9e338 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,20 @@ +0 info it worked if it ends with ok +1 verbose cli [ 'node', '/usr/local/bin/npm', 'cache', 'clean' ] +2 info using npm@1.4.28 +3 info using node@v0.10.36 +4 error Error: EACCES, unlink '/Users/conway/.npm/CSSwhat/0.4.7' +4 error { [Error: EACCES, unlink '/Users/conway/.npm/CSSwhat/0.4.7'] +4 error errno: 3, +4 error code: 'EACCES', +4 error path: '/Users/conway/.npm/CSSwhat/0.4.7' } +5 error Please try running this command again as root/Administrator. +6 error System Darwin 14.1.0 +7 error command "node" "/usr/local/bin/npm" "cache" "clean" +8 error cwd /Users/Projects/node-red +9 error node -v v0.10.36 +10 error npm -v 1.4.28 +11 error path /Users/conway/.npm/CSSwhat/0.4.7 +12 error code EACCES +13 error errno 3 +14 error stack Error: EACCES, unlink '/Users/conway/.npm/CSSwhat/0.4.7' +15 verbose exit [ 3, true ] diff --git a/test/nodes/core/storage/28-tail_spec.js b/test/nodes/core/storage/28-tail_spec.js index d5e8422f2..fcd185295 100644 --- a/test/nodes/core/storage/28-tail_spec.js +++ b/test/nodes/core/storage/28-tail_spec.js @@ -89,7 +89,7 @@ describe('tail Node', function() { }); it('should handle a non-existent file', function(done) { - fs.unlinkSync(fileToTail); + fs.writeFileSync(fileToTail, "Tail message line.\n"); var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]}, {id:"helperNode1", type:"helper", wires:[]}]; helper.load(tailNode, flow, function() { @@ -100,9 +100,12 @@ describe('tail Node', function() { msg.payload.should.equal("Tail message line"); done(); }); + setTimeout(function(){ + fs.unlinkSync(fileToTail); + },500); setTimeout( function() { fs.writeFile(fileToTail, "Tail message line\n"); - },wait); + },1000); }); });