Repository navigation
Fill the refresh cache before the concurrent requests in the refresh test - #330
Merged
Merged
Conversation
TestAuthJWTRefreshConcurrentWithCache expected one cache miss and one refresh from 100 requests carrying the same expired token, and relied on a 1ms delay between launches for that. The middleware checks the cache and fills it as separate steps, so on a loaded machine a second request missed the cache before the first stored its token, and the race run failed with 2 misses and 2 refreshes. One request now fills the cache first and the other 99 run together with no delay, in both modules.
Coverage Report for CI Build 43066481322Coverage decreased (-0.02%) to 87.046%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestAuthJWTRefreshConcurrentWithCachefails under-raceon a loaded machine, with 2 cache misses and 2 refreshes instead of 1. It sends 100 requests with the same expired token and relied on a 1ms delay between launches to get exactly one refresh. The middleware checks the refresh cache and fills it as separate steps, so a second request can miss the cache before the first one stores its token.one request now fills the cache first and the other 99 run together with no delay. The assertions stay exact (1 miss, 99 hits, 1 refresh), in both the root and v2 modules. At load 60-70 the old test failed 1 of 50 race runs on master, the new one passed 50 of 50 in each module.