diff options
Diffstat (limited to 'jstests/noPassthrough/atomic_rename_collection.js')
-rw-r--r-- | jstests/noPassthrough/atomic_rename_collection.js | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/jstests/noPassthrough/atomic_rename_collection.js b/jstests/noPassthrough/atomic_rename_collection.js index d63e08ff6ce..8a1b5526a91 100644 --- a/jstests/noPassthrough/atomic_rename_collection.js +++ b/jstests/noPassthrough/atomic_rename_collection.js @@ -12,19 +12,7 @@ let local = prim.getDB("local"); // Test both for rename within a database as across databases. - const tests = [ - { - source: first.x, - target: first.y, - expectedOplogEntries: 1, - }, - { - source: first.x, - target: second.x, - expectedOplogEntries: 4, - } - ]; - tests.forEach((test) => { + [{source: first.x, target: first.y}, {source: first.x, target: second.x}].forEach((test) => { test.source.drop(); assert.writeOK(test.source.insert({})); assert.writeOK(test.target.insert({})); @@ -37,9 +25,9 @@ }; assert.commandWorked(local.adminCommand(cmd), tojson(cmd)); ops = local.oplog.rs.find({ts: {$gt: ts}}).sort({$natural: 1}).toArray(); - assert.eq(ops.length, - test.expectedOplogEntries, - "renameCollection was supposed to only generate " + test.expectedOplogEntries + - " oplog entries: " + tojson(ops)); + assert.eq( + ops.length, + 1, + "renameCollection was supposed to only generate a single oplog entry: " + tojson(ops)); }); })(); |