diff options
Diffstat (limited to 'jstests/noPassthrough/two_phase_index_build_ops_disabled_through_applyops.js')
-rw-r--r-- | jstests/noPassthrough/two_phase_index_build_ops_disabled_through_applyops.js | 83 |
1 files changed, 38 insertions, 45 deletions
diff --git a/jstests/noPassthrough/two_phase_index_build_ops_disabled_through_applyops.js b/jstests/noPassthrough/two_phase_index_build_ops_disabled_through_applyops.js index 72ec4cdb7cb..5d19e39f40e 100644 --- a/jstests/noPassthrough/two_phase_index_build_ops_disabled_through_applyops.js +++ b/jstests/noPassthrough/two_phase_index_build_ops_disabled_through_applyops.js @@ -7,50 +7,43 @@ (function() { - const replSet = new ReplSetTest({ - nodes: [ - {}, - { - // Disallow elections on secondary. - rsConfig: { - priority: 0, - votes: 0, - }, +const replSet = new ReplSetTest({ + nodes: [ + {}, + { + // Disallow elections on secondary. + rsConfig: { + priority: 0, + votes: 0, }, - ] - }); - - replSet.startSet(); - replSet.initiate(); - - const testDB = replSet.getPrimary().getDB('test'); - const coll = testDB.twoPhaseIndexBuild; - const cmdNs = testDB.getName() + ".$cmd"; - - coll.insert({a: 1}); - - assert.commandFailedWithCode(testDB.adminCommand({ - applyOps: [ - {op: "c", ns: cmdNs, o: {startIndexBuild: coll.getName(), key: {a: 1}, name: 'a_1'}} - ] - }), - [ErrorCodes.CommandNotSupported, ErrorCodes.FailedToParse]); - - assert.commandFailedWithCode(testDB.adminCommand({ - applyOps: [{ - op: "c", - ns: cmdNs, - o: {commitIndexBuild: coll.getName(), key: {a: 1}, name: 'a_1'} - }] - }), - [ErrorCodes.CommandNotSupported, ErrorCodes.FailedToParse]); - - assert.commandFailedWithCode(testDB.adminCommand({ - applyOps: [ - {op: "c", ns: cmdNs, o: {abortIndexBuild: coll.getName(), key: {a: 1}, name: 'a_1'}} - ] - }), - [ErrorCodes.CommandNotSupported, ErrorCodes.FailedToParse]); - - replSet.stopSet(); + }, + ] +}); + +replSet.startSet(); +replSet.initiate(); + +const testDB = replSet.getPrimary().getDB('test'); +const coll = testDB.twoPhaseIndexBuild; +const cmdNs = testDB.getName() + ".$cmd"; + +coll.insert({a: 1}); + +assert.commandFailedWithCode(testDB.adminCommand({ + applyOps: [{op: "c", ns: cmdNs, o: {startIndexBuild: coll.getName(), key: {a: 1}, name: 'a_1'}}] +}), + [ErrorCodes.CommandNotSupported, ErrorCodes.FailedToParse]); + +assert.commandFailedWithCode(testDB.adminCommand({ + applyOps: + [{op: "c", ns: cmdNs, o: {commitIndexBuild: coll.getName(), key: {a: 1}, name: 'a_1'}}] +}), + [ErrorCodes.CommandNotSupported, ErrorCodes.FailedToParse]); + +assert.commandFailedWithCode(testDB.adminCommand({ + applyOps: [{op: "c", ns: cmdNs, o: {abortIndexBuild: coll.getName(), key: {a: 1}, name: 'a_1'}}] +}), + [ErrorCodes.CommandNotSupported, ErrorCodes.FailedToParse]); + +replSet.stopSet(); })(); |