summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2015-02-20 11:57:48 -0500
committerBenety Goh <benety@mongodb.com>2015-02-20 17:50:02 -0500
commitd1f28a215463d1ee2c8d2109bb55e2c891477e56 (patch)
tree04a3e9c9596446e81e2dd99c29ce7e7709903e50 /jstests
parent9fa0565f2b45cf1faebf3cb62c6777b7373dee08 (diff)
downloadmongo-d1f28a215463d1ee2c8d2109bb55e2c891477e56.tar.gz
SERVER-17336 skip compact_keeps_indexes.js in master/slave test
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/compact_keeps_indexes.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/jstests/core/compact_keeps_indexes.js b/jstests/core/compact_keeps_indexes.js
index 6e6d4686845..09978004770 100644
--- a/jstests/core/compact_keeps_indexes.js
+++ b/jstests/core/compact_keeps_indexes.js
@@ -27,16 +27,24 @@
// Run compact repeatedly while simultaneously creating and dropping a collection in a
// different database.
- var dropCollectionShell = startParallelShell(function() {
- var t = db.getSiblingDB('test_compact_keeps_indexes_drop').testcoll;
- t.drop();
- for (var i=0; i<100; i++) {
- t.save({a: 1});
+ // Skip this test case in master/slave mode because of database cloning behavior in slaves.
+ // The test uses a single collection in the database test_compact_keeps_indexes_drop
+ // which triggers a series of slow resync operations in the slave as the collection is
+ // repeatedly created and dropped.
+ var isMasterSlave = testingReplication &&
+ !assert.commandWorked(db.isMaster()).hasOwnProperty('setName');
+ if (!isMasterSlave) {
+ var dropCollectionShell = startParallelShell(function() {
+ var t = db.getSiblingDB('test_compact_keeps_indexes_drop').testcoll;
t.drop();
+ for (var i=0; i<100; i++) {
+ t.save({a: 1});
+ t.drop();
+ }
+ });
+ for (var i=0; i<10; i++) {
+ coll.runCommand('compact');
}
- });
- for (var i=0; i<10; i++) {
- coll.runCommand('compact');
+ dropCollectionShell();
}
- dropCollectionShell();
}())