Skip to content

Commit

Permalink
Resolve race condition in tests by keeping event loop alive
Browse files Browse the repository at this point in the history
Add a dummy setTimeout() call that keeps the event loop alive
long enough to receive signals.
There may be better ways to do this, but this is simple and seems
sufficiently reliable.
  • Loading branch information
addaleax authored and isaacs committed Apr 5, 2016
1 parent 8626443 commit bd26d72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env node
console.log('%j', process.execArgv)
console.log('%j', process.argv.slice(2))

// Keep the event loop alive long enough to receive signals.
setTimeout(function() {}, 100)

0 comments on commit bd26d72

Please sign in to comment.