From c66c033605deb6b2c950e7b73172cd4e960a00a0 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Wed, 5 May 2021 16:23:58 +0000 Subject: [PATCH] SERVER-56671 Reintroduce delay in user acquisition during test --- jstests/auth/user-cache-invalidation.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jstests/auth/user-cache-invalidation.js b/jstests/auth/user-cache-invalidation.js index c5a6e54065e..ec5ab87b9c4 100644 --- a/jstests/auth/user-cache-invalidation.js +++ b/jstests/auth/user-cache-invalidation.js @@ -137,9 +137,17 @@ function runTest(writeNode, readNode, awaitReplication, lock, unlock) { } // Set the failpoint before we start the parallel thread. - let fp = configureFailPoint( + const fp = configureFailPoint( readNode, 'waitForUserCacheInvalidation', {userName: {db: testDB, user: testUser}}); + // We need some time to mutate the auth state before the acquisition completes. + const kResolveRolesDelayMS = 5 * 1000; + assert.commandWorked(readAdmin.runCommand({ + configureFailPoint: 'authLocalGetUser', + mode: 'alwaysOn', + data: {resolveRolesDelayMS: NumberInt(kResolveRolesDelayMS)} + })); + const thread = new Thread(function(port, testUser, testDB) { const mongo = new Mongo('localhost:' + port); assert(mongo);