SERVER-76335 assertRetryableCommandWorked should check command results
This commit is contained in:
committed by
Evergreen Agent
parent
342b9c56d7
commit
80f7c41df0
@@ -30,7 +30,7 @@ configureFailPoint = function(conn, failPointName, data = {}, failPointMode = "a
|
||||
// number of times the fail point is entered between the time it returns
|
||||
// and the next time it gets called.
|
||||
sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
conn.adminCommand({
|
||||
return conn.adminCommand({
|
||||
waitForFailPoint: failPointName,
|
||||
timesEntered: this.timesEntered + timesEntered,
|
||||
maxTimeMS: maxTimeMS
|
||||
@@ -54,7 +54,7 @@ configureFailPoint = function(conn, failPointName, data = {}, failPointMode = "a
|
||||
},
|
||||
off: function() {
|
||||
sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
conn.adminCommand({configureFailPoint: failPointName, mode: "off"});
|
||||
return conn.adminCommand({configureFailPoint: failPointName, mode: "off"});
|
||||
}, "Timed out disabling fail point " + failPointName);
|
||||
}
|
||||
};
|
||||
@@ -74,7 +74,7 @@ configureFailPointForRS = function(conns, failPointName, data = {}, failPointMod
|
||||
off: function() {
|
||||
conns.forEach((conn) => {
|
||||
sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
conn.adminCommand({configureFailPoint: failPointName, mode: "off"});
|
||||
return conn.adminCommand({configureFailPoint: failPointName, mode: "off"});
|
||||
}, "Timed out disabling fail point " + failPointName);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ sh.assertRetryableCommandWorkedOrFailedWithCodes = function(cmd, msg, expectedEr
|
||||
var res = undefined;
|
||||
assert.soon(function() {
|
||||
try {
|
||||
res = cmd();
|
||||
res = assert.commandWorked(cmd());
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (err instanceof WriteError && ErrorCodes.isRetriableError(err.code)) {
|
||||
@@ -271,7 +271,7 @@ sh.disableAutoMerge = function(coll) {
|
||||
}
|
||||
|
||||
return sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
dbase.getSiblingDB("config").collections.update(
|
||||
return dbase.getSiblingDB("config").collections.update(
|
||||
{_id: coll + ""},
|
||||
{$set: {"enableAutoMerge": false}},
|
||||
{writeConcern: {w: 'majority', wtimeout: 60000}});
|
||||
@@ -290,7 +290,7 @@ sh.enableAutoMerge = function(coll) {
|
||||
}
|
||||
|
||||
return sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
dbase.getSiblingDB("config").collections.update(
|
||||
return dbase.getSiblingDB("config").collections.update(
|
||||
{_id: coll + ""},
|
||||
{$unset: {"enableAutoMerge": 1}},
|
||||
{writeConcern: {w: 'majority', wtimeout: 60000}});
|
||||
@@ -369,7 +369,7 @@ sh.disableBalancing = function(coll) {
|
||||
}
|
||||
|
||||
return sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
dbase.getSiblingDB("config").collections.update(
|
||||
return dbase.getSiblingDB("config").collections.update(
|
||||
{_id: coll + ""},
|
||||
{$set: {"noBalance": true}},
|
||||
{writeConcern: {w: 'majority', wtimeout: 60000}});
|
||||
@@ -388,7 +388,7 @@ sh.enableBalancing = function(coll) {
|
||||
}
|
||||
|
||||
return sh.assertRetryableCommandWorkedOrFailedWithCodes(() => {
|
||||
dbase.getSiblingDB("config").collections.update(
|
||||
return dbase.getSiblingDB("config").collections.update(
|
||||
{_id: coll + ""},
|
||||
{$set: {"noBalance": false}},
|
||||
{writeConcern: {w: 'majority', wtimeout: 60000}});
|
||||
|
||||
Reference in New Issue
Block a user