-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Security 2022-02-21, Security 2022-05-02, Security 2022-05-16
-
15
The mongos_cache_invalidation.js test checks to see whether mongoses in a sharded cluster invalidate their user caches after various UMCs are run. It enforces that the invalidation must occur within 10 seconds, while each mongos polls the config server for user cache generation changes every 5 seconds. In order to test for invalidation, the test tries running update commands as the user whose privileges have been changed and expects to see the update fail after at most 10 seconds.
This works the vast majority of the time, but occasionally the update command takes longer than expected (6-7 seconds). This is enough to run out the clock even if the cache is invalidated during the update.
In order to mitigate the odds of this happening, we should increase the time the test tries to assert the propagation for. Alternatively, the test could also sleep for a few seconds before the updates start to increase the odds of the invalidation occurring before the update commands start.