From c9b22a985643e4c5ec97bf6d411208fb3ba9cf40 Mon Sep 17 00:00:00 2001
From: Zachary Carter <zack.carter@gmail.com>
Date: Wed, 23 May 2012 16:37:40 -0700
Subject: [PATCH] Fix start-stop.js test module to look for router output and
 ignore tokens found in "forwarding request" output lines

---
 tests/lib/start-stop.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/lib/start-stop.js b/tests/lib/start-stop.js
index 895ae04f4..b73aa2ea8 100644
--- a/tests/lib/start-stop.js
+++ b/tests/lib/start-stop.js
@@ -47,14 +47,16 @@ function setupProc(proc) {
       }
       var tokenRegex = new RegExp('token=([A-Za-z0-9]+)$', 'm');
 
-      if (!sentReady && /^browserid.*127\.0\.0\.1:10002$/.test(x)) {
+      if (!sentReady && /^router.*127\.0\.0\.1:10002$/.test(x)) {
         exports.browserid.emit('ready');
         sentReady = true;
       } else if (m = tokenRegex.exec(x)) {
-        tokenStack.push(m[1]);
-        if (nextTokenFunction) {
-          nextTokenFunction(tokenStack.shift());
-          nextTokenFunction = undefined;
+        if (!(/forwarding request:/.test(x))) {
+          tokenStack.push(m[1]);
+          if (nextTokenFunction) {
+            nextTokenFunction(tokenStack.shift());
+            nextTokenFunction = undefined;
+          }
         }
       }
     });
-- 
GitLab