diff options
author | Irina Yatsenko <irina.yatsenko@mongodb.com> | 2021-06-02 00:46:16 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-02 01:18:12 +0000 |
commit | 911e585044f76bb244f425066bfcb838e9dfb258 (patch) | |
tree | ed3979524ade6abdc931afdfc62f6200e2b3f7f6 /jstests/auth | |
parent | 2da60c28f0996433e61e80ac5cfdde621244837e (diff) | |
download | mongo-911e585044f76bb244f425066bfcb838e9dfb258.tar.gz |
SERVER-57198 Remove getLastError calls from tests where it's easy to do so
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/resource_pattern_matching.js | 14 | ||||
-rw-r--r-- | jstests/auth/user_defined_roles_on_secondaries.js | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/jstests/auth/resource_pattern_matching.js b/jstests/auth/resource_pattern_matching.js index 7261890ef9d..b02fe7951e6 100644 --- a/jstests/auth/resource_pattern_matching.js +++ b/jstests/auth/resource_pattern_matching.js @@ -28,16 +28,14 @@ function setup_dbs_and_cols(db) { var test_db_a = db.getSiblingDB("a"); var test_db_b = db.getSiblingDB("b"); - test_db_a.dropDatabase(); - test_db_b.dropDatabase(); + assert.commandWorked(test_db_a.dropDatabase({w: 'majority'})); + assert.commandWorked(test_db_b.dropDatabase({w: 'majority'})); - test_db_a.createCollection("a"); - test_db_a.createCollection("b"); + assert.commandWorked(test_db_a.createCollection("a", {writeConcern: {w: 'majority'}})); + assert.commandWorked(test_db_a.createCollection("b", {writeConcern: {w: 'majority'}})); - test_db_b.createCollection("a"); - test_db_b.createCollection("b"); - - db.getLastError('majority'); + assert.commandWorked(test_db_b.createCollection("a", {writeConcern: {w: 'majority'}})); + assert.commandWorked(test_db_b.createCollection("b", {writeConcern: {w: 'majority'}})); } function grant_privileges(granter, privileges) { diff --git a/jstests/auth/user_defined_roles_on_secondaries.js b/jstests/auth/user_defined_roles_on_secondaries.js index d05d44ff749..4d44a9bbfd0 100644 --- a/jstests/auth/user_defined_roles_on_secondaries.js +++ b/jstests/auth/user_defined_roles_on_secondaries.js @@ -214,7 +214,8 @@ assert.commandWorked(rstest.getPrimary().getDB("admin").runCommand({ ] })); -assert.commandWorked(rstest.getPrimary().getDB("admin").getLastErrorObj(2)); +rstest.awaitReplication(); + rstest.nodes.forEach(function(node) { var role = node.getDB("db1").getRole("t1"); assert.eq(1, role.roles.length, tojson(node)); |