summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-02-01 15:55:03 -0800
committerisaacs <i@izs.me>2013-02-01 15:58:51 -0800
commit916aebabb83745dd7b1402a92f120107fa6ea6b6 (patch)
tree01b64980f1b4959136ab09562514ff17304465fb
parent3f65916fa995c74b0db2064911fe76d18d3509b6 (diff)
downloadnode-916aebabb83745dd7b1402a92f120107fa6ea6b6.tar.gz
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'.
-rw-r--r--src/node.js3
-rw-r--r--test/simple/test-debugger-client.js1
-rw-r--r--test/simple/test-debugger-repl-utf8.js1
-rw-r--r--test/simple/test-debugger-repl.js1
4 files changed, 5 insertions, 1 deletions
diff --git a/src/node.js b/src/node.js
index 9fc68e498..64a888935 100644
--- a/src/node.js
+++ b/src/node.js
@@ -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
diff --git a/test/simple/test-debugger-client.js b/test/simple/test-debugger-client.js
index 5102a7b37..70606bef3 100644
--- a/test/simple/test-debugger-client.js
+++ b/test/simple/test-debugger-client.js
@@ -22,6 +22,7 @@
+process.env.NODE_DEBUGGER_TIMEOUT = 200;
var common = require('../common');
var assert = require('assert');
var debug = require('_debugger');
diff --git a/test/simple/test-debugger-repl-utf8.js b/test/simple/test-debugger-repl-utf8.js
index 720410de5..a46075e32 100644
--- a/test/simple/test-debugger-repl-utf8.js
+++ b/test/simple/test-debugger-repl-utf8.js
@@ -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;
diff --git a/test/simple/test-debugger-repl.js b/test/simple/test-debugger-repl.js
index fb06441e7..01e3ef778 100644
--- a/test/simple/test-debugger-repl.js
+++ b/test/simple/test-debugger-repl.js
@@ -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;