Skip to content
Browse files

don't check for db.serverStatus().metrics on mongos

  • Loading branch information...
1 parent 8bc01d2 commit 4252beda7ebbadc24c61dabed66a0609e6ac3dae @erh erh committed
Showing with 9 additions and 3 deletions.
  1. +9 −3 jstests/find1.js
View
12 jstests/find1.js
@@ -1,7 +1,10 @@
t = db.find1;
t.drop();
-nscannedStart = db.serverStatus().metrics.document.scanned
+if ( db.serverStatus().metrics ) {
+ // ignore mongos
+ nscannedStart = db.serverStatus().metrics.document.scanned
+}
t.save( { a : 1 , b : "hi" } );
t.save( { a : 2 , b : "hi" } );
@@ -32,5 +35,8 @@ assert( ! t.findOne( id , { a : 1 } ).b , "I" );
assert(t.validate().valid,"not valid");
-nscannedEnd = db.serverStatus().metrics.document.scanned
-assert.lte( nscannedStart + 16, nscannedEnd );
+if ( db.serverStatus().metrics ) {
+ // ignore mongos
+ nscannedEnd = db.serverStatus().metrics.document.scanned
+ assert.lte( nscannedStart + 16, nscannedEnd );
+}

0 comments on commit 4252bed

Please sign in to comment.
Something went wrong with that request. Please try again.