summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtest/node/write_callback/app.js7
-rw-r--r--test/test_node_application.py5
2 files changed, 9 insertions, 3 deletions
diff --git a/test/node/write_callback/app.js b/test/node/write_callback/app.js
index 9d4bc1c5..3a9e51e8 100755
--- a/test/node/write_callback/app.js
+++ b/test/node/write_callback/app.js
@@ -1,10 +1,13 @@
#!/usr/bin/env node
+var fs = require('fs');
+
require('unit-http').createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
- var a = 'blah';
+ var a = 'world';
res.write('hello', 'utf8', function() {
- a = 'world';
+ a = 'blah';
+ fs.appendFile('callback', '', function() {});
});
res.end(a);
}).listen(7080);
diff --git a/test/test_node_application.py b/test/test_node_application.py
index 715173e6..b736058c 100644
--- a/test/test_node_application.py
+++ b/test/test_node_application.py
@@ -112,11 +112,14 @@ class TestUnitNodeApplication(unit.TestUnitApplicationNode):
self.assertEqual(self.get()['body'], '6\r\nbuffer\r\n0\r\n\r\n',
'write buffer')
+ @unittest.expectedFailure
def test_node_application_write_callback(self):
self.load('write_callback')
self.assertEqual(self.get()['body'],
- '5\r\nhello\r\n5\r\nworld\r\n0\r\n\r\n', 'write callback')
+ '5\r\nhello\r\n5\r\nworld\r\n0\r\n\r\n', 'write callback order')
+ self.assertTrue(self.waitforfiles(self.testdir + '/node/callback'),
+ 'write callback')
def test_node_application_write_before_writeHead(self):
self.skip_alerts.append(r'process \d+ exited on signal')