diff options
author | Kristina <kristina@10gen.com> | 2012-10-04 18:56:46 -0400 |
---|---|---|
committer | Kristina <kristina@10gen.com> | 2012-10-04 18:56:54 -0400 |
commit | efbca4cd123faaa1c9b12d82612a95e525c1bd98 (patch) | |
tree | 312e66c104af60cc80ea3c0fdd14290cca44de9b /jstests | |
parent | 60305ad7a4512abc06b902f028fa9fc05ff0f5bd (diff) | |
download | mongo-efbca4cd123faaa1c9b12d82612a95e525c1bd98.tar.gz |
SERVER-1929 Fix test to handle a stepdown
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/replsets/stale_clustered.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/jstests/replsets/stale_clustered.js b/jstests/replsets/stale_clustered.js index 916a0647750..6f173186d29 100644 --- a/jstests/replsets/stale_clustered.js +++ b/jstests/replsets/stale_clustered.js @@ -93,7 +93,18 @@ rsA.waitForState( rsA.getSecondaries(), rsA.SECONDARY, 5 * 60 * 1000 ) prt("10: check our regular and slaveOk query") -assert.eq( coll.find().itcount(), collSOk.find().itcount() ) +function compareCount() { + try { + return coll.find().itcount() == collSOk.find().itcount(); + } catch (x) { + return false; + } +}; + +// there may have been a stepdown caused by step 8, so we run this twice in a row. The first time +// can error out +compareCount(); +assert(compareCount()) prt("DONE\n\n\n"); |