diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2020-11-12 18:02:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-17 17:24:14 +0000 |
commit | f4a3ef9b697d747462045829130c23e82ccce960 (patch) | |
tree | 0c86b967c6ee67fd03bdf8b2d7c8c1a551380ed8 /jstests/ssl | |
parent | 44f2e1e43abeb6777f22635b6a0020beb06f7ad9 (diff) | |
download | mongo-f4a3ef9b697d747462045829130c23e82ccce960.tar.gz |
SERVER-52826 Await replication in speculative auth test
Diffstat (limited to 'jstests/ssl')
-rw-r--r-- | jstests/ssl/speculative-auth-sharding.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/jstests/ssl/speculative-auth-sharding.js b/jstests/ssl/speculative-auth-sharding.js index 7a198c7983b..4a45af1c3f7 100644 --- a/jstests/ssl/speculative-auth-sharding.js +++ b/jstests/ssl/speculative-auth-sharding.js @@ -94,9 +94,18 @@ assert.eq(authCluster.successful, initCluster.successful + 1); jsTest.log('Shutting down'); // Authenticate csrs so ReplSetTest.stopSet() can do db hash check. +// It's possible the admin account hasn't replicated yet, so give it time. if (st.configRS) { - st.configRS.nodes.forEach((node) => { - node.getDB('admin').auth('admin', 'pwd'); + const nodes = st.configRS.nodes.map((x) => x); + let node = nodes.pop(); + assert.soon(function() { + if (node === undefined) { + return true; + } + if (node.getDB('admin').auth('admin', 'pwd')) { + node = nodes.pop(); + } + return false; }); } |