summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/sharding/stats.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/jstests/sharding/stats.js b/jstests/sharding/stats.js
index 50c53872bca..72dad63b6ca 100644
--- a/jstests/sharding/stats.js
+++ b/jstests/sharding/stats.js
@@ -43,6 +43,10 @@
bulk.insert({_id: i});
assert.writeOK(bulk.execute());
+ // Flush all writes to disk since some of the stats are dependent on state in disk (like
+ // totalIndexSize).
+ assert.commandWorked(db.adminCommand({fsync: 1}));
+
x = db.foo.stats();
assert.eq(N, x.count, "coll total count expected");
assert.eq(db.foo.count(), x.count, "coll total count match");