From fa179ecba21564a90c46fcafbd8914567dd396eb Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Thu, 6 Jun 2013 08:00:34 +1000 Subject: [PATCH] added a delay to dateFile test, to let the filesystem catch up --- test/dateFileAppender-test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/dateFileAppender-test.js b/test/dateFileAppender-test.js index ae4f157..f9530ad 100644 --- a/test/dateFileAppender-test.js +++ b/test/dateFileAppender-test.js @@ -99,7 +99,8 @@ vows.describe('../lib/appenders/dateFile').addBatch({ }, 'with options.alwaysIncludePattern': { topic: function() { - var log4js = require('../lib/log4js') + var self = this + , log4js = require('../lib/log4js') , format = require('../lib/date_format') , logger , options = { @@ -127,7 +128,10 @@ vows.describe('../lib/appenders/dateFile').addBatch({ logger = log4js.getLogger('tests'); logger.warn('this should be written to the file with the appended date'); this.teardown = removeFile('date-file-test' + thisTime); - fs.readFile(path.join(__dirname, 'date-file-test' + thisTime), 'utf8', this.callback); + //wait for filesystem to catch up + setTimeout(function() { + fs.readFile(path.join(__dirname, 'date-file-test' + thisTime), 'utf8', self.callback); + }, 100); }, 'should create file with the correct pattern': function(contents) { assert.include(contents, 'this should be written to the file with the appended date');