summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2017-04-14 11:01:23 -0400
committerRandolph Tan <randolph@10gen.com>2018-11-06 11:44:56 -0500
commit67b6090dd4bfb2ae27d090a07fe30d47cf673601 (patch)
tree372a645e0984887b59150fb1f8ac669e01c1735e
parent91c7456f24342e2b11b9cd486f7e8bc5d8b1f90e (diff)
downloadmongo-67b6090dd4bfb2ae27d090a07fe30d47cf673601.tar.gz
SERVER-28716 Call fsync after setup before calling collStats/dbStats in jstests/sharding/stats.js
(cherry picked from commit dc2e2b281bf7bc89de73c9bb7bf8d587ba40291c)
-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");