summaryrefslogtreecommitdiff
path: root/jstests/sharding/auth.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-11-01 08:05:47 -0400
committerEliot Horowitz <eliot@10gen.com>2011-11-01 08:05:47 -0400
commit897466810d7b883fd71792d4fd51d220026dabcf (patch)
tree1ef7c7c8efcceb5f88446c96e3718a149794f37b /jstests/sharding/auth.js
parent975be960bb8617723b93c971d2f2afdc74550146 (diff)
downloadmongo-897466810d7b883fd71792d4fd51d220026dabcf.tar.gz
make auth test reliable
Diffstat (limited to 'jstests/sharding/auth.js')
-rw-r--r--jstests/sharding/auth.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/jstests/sharding/auth.js b/jstests/sharding/auth.js
index 8d8d7d79dab..c9bf1e14106 100644
--- a/jstests/sharding/auth.js
+++ b/jstests/sharding/auth.js
@@ -146,13 +146,17 @@ for (i=0; i<num; i++) {
s.getDB("test").foo.insert({x:i, abc : "defg", date : new Date(), str : "all the talk on the market"});
}
-var d1Chunks = s.getDB("config").chunks.count({shard : "d1"});
-var d2Chunks = s.getDB("config").chunks.count({shard : "d2"});
-var totalChunks = s.getDB("config").chunks.count({ns : "test.foo"});
+assert.soon( function(){
-print("chunks: " + d1Chunks+" "+d2Chunks+" "+totalChunks);
+ var d1Chunks = s.getDB("config").chunks.count({shard : "d1"});
+ var d2Chunks = s.getDB("config").chunks.count({shard : "d2"});
+ var totalChunks = s.getDB("config").chunks.count({ns : "test.foo"});
-assert(d1Chunks > 0 && d2Chunks > 0 && d1Chunks+d2Chunks == totalChunks);
+ print("chunks: " + d1Chunks+" "+d2Chunks+" "+totalChunks);
+
+ return d1Chunks > 0 && d2Chunks > 0 && d1Chunks+d2Chunks == totalChunks;
+ }
+ )
assert.eq(s.getDB("test").foo.count(), num+1);