debugger: Make the debugger timeout configurable

If the NODE_DEBUGGER_TIMEOUT environment variable is set, then use
that as the number of ms to wait for the debugger to start.

This is primarily to work around a race condition that almost never
happens in real usage with the debugger, but happens EVERY FRACKING
TIME when the debugger tests run as part of 'make test'.
This commit is contained in:
isaacs 2013-02-01 15:55:03 -08:00
parent 3f65916fa9
commit 916aebabb8
4 changed files with 5 additions and 1 deletions

View File

@ -111,7 +111,8 @@
// global.v8debug object about a connection, and runMain when
// that occurs. --isaacs
setTimeout(Module.runMain, 50);
var debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50;
setTimeout(Module.runMain, debugTimeout);
} else {
// REMOVEME: nextTick should not be necessary. This hack to get

View File

@ -22,6 +22,7 @@
process.env.NODE_DEBUGGER_TIMEOUT = 200;
var common = require('../common');
var assert = require('assert');
var debug = require('_debugger');

View File

@ -20,6 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
process.env.NODE_DEBUGGER_TIMEOUT = 200;
var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;

View File

@ -20,6 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
process.env.NODE_DEBUGGER_TIMEOUT = 200;
var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;