Permalink
Browse files

Tweak test server to reveal concurrency bug.

  • Loading branch information...
1 parent 8240ff7 commit 83234e20c65a53358bdcdd51a43c0d484b73c1dd @aseemk committed Oct 10, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 test/app.js
View
@@ -11,7 +11,10 @@ app.set('view engine', 'html');
app.register('.html', require('ejs'));
app.get('/', function (req, res) {
- res.render('child');
+ // create an artificial delay to test concurrency
+ setTimeout(function () {
+ res.render('child');
+ }, 1000);
});
// since this is a test server, don't listen -- just return the server.

3 comments on commit 83234e2

gasi replied Oct 10, 2011

Were you able to repro it?

Owner

aseemk replied Oct 10, 2011

Yep! This is because expresso (the test runner this uses) runs tests in parallel, so adding a delay ensured that the concurrency bug was hit.

gasi replied Oct 10, 2011

Beautiful.

Please sign in to comment.