From 336a1db69131635d33f3b7cf8a7a31353d10407c Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Wed, 27 Apr 2011 00:09:07 -0400 Subject: [PATCH] better debugging --- jstests/replsets/remove1.js | 5 +++-- jstests/replsets/rslib.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jstests/replsets/remove1.js b/jstests/replsets/remove1.js index b5f9a4f1a00..d6d36e40f25 100644 --- a/jstests/replsets/remove1.js +++ b/jstests/replsets/remove1.js @@ -82,8 +82,9 @@ wait(function() { printjson(master.getDB("admin").runCommand({replSetGetStatus:1})); master.setSlaveOk(); var newConfig = master.getDB("local").system.replset.findOne(); + print( "newConfig: " + tojson(newConfig) ); return newConfig.version == 4; - }); +} , "wait1" ); print("Make sure everyone's secondary"); @@ -103,7 +104,7 @@ wait(function() { } } return true; - }); +} , "wait2" ); replTest.stopSet(); diff --git a/jstests/replsets/rslib.js b/jstests/replsets/rslib.js index 6434cddcf96..19271c9e13d 100644 --- a/jstests/replsets/rslib.js +++ b/jstests/replsets/rslib.js @@ -2,7 +2,7 @@ var count = 0; var w = 0; -var wait = function(f) { +var wait = function(f,msg) { w++; var n = 0; while (!f()) { @@ -11,7 +11,7 @@ var wait = function(f) { if (++n == 4) { print("" + f); } - assert(n < 200, 'tried 200 times, giving up'); + assert(n < 200, 'tried 200 times, giving up on ' + msg ); sleep(1000); } };