summaryrefslogtreecommitdiff
path: root/test/simple/test-debugger-client.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-01-11 16:30:01 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-01-11 16:30:01 -0800
commit7c0f453b7cccb04808d4c7d84b852f6d4b8be932 (patch)
tree1d5e2d8d5da01a92a5eeccfba97b65af9dd5af8b /test/simple/test-debugger-client.js
parent8e461673c44cb550a7aadc20f0af6453810f1b18 (diff)
downloadnode-new-7c0f453b7cccb04808d4c7d84b852f6d4b8be932.tar.gz
Add delay into test-debugger-client
Diffstat (limited to 'test/simple/test-debugger-client.js')
-rw-r--r--test/simple/test-debugger-client.js30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/simple/test-debugger-client.js b/test/simple/test-debugger-client.js
index a517f56ba7..03c6159b91 100644
--- a/test/simple/test-debugger-client.js
+++ b/test/simple/test-debugger-client.js
@@ -126,23 +126,27 @@ function doTest(cb, done) {
var didTryConnect = false;
nodeProcess.stderr.setEncoding('utf8');
+ var b = ''
nodeProcess.stderr.on('data', function (data) {
- if (didTryConnect == false && /debugger/.test(data)) {
+ b += data;
+ if (didTryConnect == false && /debugger listening on port/.test(b)) {
didTryConnect = true;
- // Wait for some data before trying to connect
- var c = new debug.Client();
- process.stdout.write(">>> connecting...");
- c.connect(debug.port)
- c.on('ready', function () {
- connectCount++;
- console.log("ready!");
- cb(c, function () {
- console.error(">>> killing node process %d\n\n", nodeProcess.pid);
- nodeProcess.kill();
- done();
+ setTimeout(function() {
+ // Wait for some data before trying to connect
+ var c = new debug.Client();
+ process.stdout.write(">>> connecting...");
+ c.connect(debug.port)
+ c.on('ready', function () {
+ connectCount++;
+ console.log("ready!");
+ cb(c, function () {
+ console.error(">>> killing node process %d\n\n", nodeProcess.pid);
+ nodeProcess.kill();
+ done();
+ });
});
- });
+ }, 100);
}
});
}