summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2015-12-11 11:40:19 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2015-12-11 11:42:26 -0500
commitbb7e7fc215e4c7a08bf8f525cbdd0b1a4c720c1f (patch)
tree591d5e77f457600d84539cd520b367aefbd45daa
parentfc108ae9e61fc0b23cc8035dc8eeb14ed539ed33 (diff)
downloadmongo-bb7e7fc215e4c7a08bf8f525cbdd0b1a4c720c1f.tar.gz
SERVER-21164 Use throw instead of assert in rslib.js wait loop
(cherry picked from commit 8fef1b5e7aea0d5b8683b580487b1e22e3a30c41)
-rw-r--r--jstests/replsets/rslib.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/jstests/replsets/rslib.js b/jstests/replsets/rslib.js
index d4cea8a51eb..bff0a04182d 100644
--- a/jstests/replsets/rslib.js
+++ b/jstests/replsets/rslib.js
@@ -13,7 +13,9 @@ wait = function(f,msg) {
if (++n == 4) {
print("" + f);
}
- assert(n < 200, 'tried 200 times, giving up on ' + msg );
+ if (n >= 200) {
+ throw new Error('tried 200 times, giving up on ' + msg);
+ }
sleep(1000);
}
};