From c1a45ebbb0530e3d0201321d725527f1eb83ffce Mon Sep 17 00:00:00 2001 From: "clang-format-7.0.1" Date: Fri, 26 Jul 2019 18:42:24 -0400 Subject: Apply formatting per `clang-format-7.0.1` --- jstests/noPassthrough/atomic_rename_collection.js | 82 +++++++++++------------ 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'jstests/noPassthrough/atomic_rename_collection.js') diff --git a/jstests/noPassthrough/atomic_rename_collection.js b/jstests/noPassthrough/atomic_rename_collection.js index c8e24f1c591..a6f39c1c40f 100644 --- a/jstests/noPassthrough/atomic_rename_collection.js +++ b/jstests/noPassthrough/atomic_rename_collection.js @@ -1,47 +1,47 @@ // @tags: [requires_replication] (function() { - // SERVER-28285 When renameCollection drops the target collection, it should just generate - // a single oplog entry, so we cannot end up in a state where the drop has succeeded, but - // the rename didn't. - let rs = new ReplSetTest({nodes: 1}); - rs.startSet(); - rs.initiate(); +// SERVER-28285 When renameCollection drops the target collection, it should just generate +// a single oplog entry, so we cannot end up in a state where the drop has succeeded, but +// the rename didn't. +let rs = new ReplSetTest({nodes: 1}); +rs.startSet(); +rs.initiate(); - let prim = rs.getPrimary(); - let first = prim.getDB("first"); - let second = prim.getDB("second"); - let local = prim.getDB("local"); +let prim = rs.getPrimary(); +let first = prim.getDB("first"); +let second = prim.getDB("second"); +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) => { - test.source.drop(); - assert.writeOK(test.source.insert({})); - assert.writeOK(test.target.insert({})); +// 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) => { + test.source.drop(); + assert.writeOK(test.source.insert({})); + assert.writeOK(test.target.insert({})); - let ts = local.oplog.rs.find().sort({$natural: -1}).limit(1).next().ts; - let cmd = { - renameCollection: test.source.toString(), - to: test.target.toString(), - dropTarget: true - }; - 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)); - }); - rs.stopSet(); + let ts = local.oplog.rs.find().sort({$natural: -1}).limit(1).next().ts; + let cmd = { + renameCollection: test.source.toString(), + to: test.target.toString(), + dropTarget: true + }; + 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)); +}); +rs.stopSet(); })(); -- cgit v1.2.1