summaryrefslogtreecommitdiff
path: root/jstests/concurrency
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2022-06-08 11:43:14 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-13 20:29:30 +0000
commita196a10fb7739014f1f5b24902cbd413dbc72954 (patch)
tree95198016d50377f3825d5a64779afd970c6109f6 /jstests/concurrency
parenteebdc45b31245de205e327304f303065211ecbbd (diff)
downloadmongo-a196a10fb7739014f1f5b24902cbd413dbc72954.tar.gz
SERVER-67117 Fix retry logic in auth_drop_role.js test
Diffstat (limited to 'jstests/concurrency')
-rw-r--r--jstests/concurrency/fsm_workloads/auth_drop_role.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/jstests/concurrency/fsm_workloads/auth_drop_role.js b/jstests/concurrency/fsm_workloads/auth_drop_role.js
index 5cff820b3e9..275e56906d6 100644
--- a/jstests/concurrency/fsm_workloads/auth_drop_role.js
+++ b/jstests/concurrency/fsm_workloads/auth_drop_role.js
@@ -47,18 +47,25 @@ var $config = (function() {
// Some test machines may hit high contention during these concurrency tests
// allow for occaisional failure with retries.
- for (var i = 3; i >= 0; --i) {
- let dropResult = db.runCommand({dropRole: roleName, maxTimeMS: kMaxCmdTimeMs});
-
- if (dropResult === true) {
- // Success
+ for (var i = 5; i >= 0; --i) {
+ let cmdResult;
+ try {
+ cmdResult = db.runCommand({dropRole: roleName, maxTimeMS: kMaxCmdTimeMs});
+ assert.commandWorked(cmdResult);
break;
- } else if (i > 0) {
- // Failure, try again
- print("Retrying a dropRole() which resulted in: " + tojson(dropResult));
- } else {
- // Out of do-overs, just die.
- assertAlways(dropResult);
+ } catch (e) {
+ if (i > 0) {
+ // Failure, try again
+ print("Retrying dropRole(" + roleName + "), previous call resulted in " +
+ tojson(cmdResult));
+ if (cmdResult.code == ErrorCodes.SnapshotUnavailable) {
+ // Give pending catalog changes a chance to catch up.
+ sleep(5000);
+ }
+ } else {
+ // Out of do-overs, just die.
+ throw e;
+ }
}
}