summaryrefslogtreecommitdiff
path: root/jstests/replsets
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-07-29 20:54:43 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-07-29 21:05:17 -0400
commitccf8a4f2deb3e566c11efb36159c04a0a02e8775 (patch)
tree8375904590aff56885e2a1c89e9db80cabf74ffd /jstests/replsets
parent7d9d65338f22220d59f57b09c1936ae6da41ac8c (diff)
downloadmongo-ccf8a4f2deb3e566c11efb36159c04a0a02e8775.tar.gz
SERVER-41696 Modify tests depending on the 'ns' field from index specs to no longer have a dependency on it
Diffstat (limited to 'jstests/replsets')
-rw-r--r--jstests/replsets/index_delete.js1
-rw-r--r--jstests/replsets/mr_nonrepl_coll_in_local_db.js11
2 files changed, 8 insertions, 4 deletions
diff --git a/jstests/replsets/index_delete.js b/jstests/replsets/index_delete.js
index 5f64979dbc3..59486bb2932 100644
--- a/jstests/replsets/index_delete.js
+++ b/jstests/replsets/index_delete.js
@@ -105,7 +105,6 @@ master.getCollection('local.oplog.rs').find().forEach(function(entry) {
assert(entry.o2.name);
assert(entry.o2.key);
assert.eq(entry.o2.v, 2);
- assert.eq(entry.o2.ns, dbName + "." + collName);
assert.eq(entry.ns, dbName + ".$cmd");
}
});
diff --git a/jstests/replsets/mr_nonrepl_coll_in_local_db.js b/jstests/replsets/mr_nonrepl_coll_in_local_db.js
index 8348b65e09a..a6d6cad7e7a 100644
--- a/jstests/replsets/mr_nonrepl_coll_in_local_db.js
+++ b/jstests/replsets/mr_nonrepl_coll_in_local_db.js
@@ -61,10 +61,15 @@ createdCollections.forEach(function(createdCollectionName) {
return;
}
+ const periodIndex = createdCollectionName.indexOf(".");
+ const dbName = createdCollectionName.substring(0, periodIndex);
+ const collName = createdCollectionName.substring(periodIndex + 1);
+
// Search for a log entry for the creation of this collection.
- const oplogEntries = primaryDB.getSiblingDB("local")["oplog.rs"]
- .find({op: "c", "o.idIndex.ns": createdCollectionName})
- .toArray();
+ const oplogEntries =
+ primaryDB.getSiblingDB("local")["oplog.rs"]
+ .find({op: "c", ns: dbName + ".$cmd", "o.create": collName, "o.idIndex.name": "_id_"})
+ .toArray();
if (createdCollectionName.startsWith("local.")) {
// We do not want to see any replication of "local" collections.
assert.eq(oplogEntries.length,