Deflake test_find_for_authentication_with_nonsense#UserTest - #74655
Open
Hamms wants to merge 2 commits into
Open
Deflake test_find_for_authentication_with_nonsense#UserTest#74655Hamms wants to merge 2 commits into
test_find_for_authentication_with_nonsense#UserTest#74655Hamms wants to merge 2 commits into
Conversation
Rather than just targeting the specific class being used by the Rails cache, which may or may not the be same as the shared cache, depending on the environment.
test_find_for_authentication_with_nonsense#UserTest
Hamms
marked this pull request as ready for review
August 14, 2026 21:44
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.
After switching the Rails cache to a FileStore, the DTT failed a couple of times with
But consistently passed on rerun, and always passes locally and in Drone. There are two issues here: the environment inconsistency and the test flakiness.
The environment inconsistency is because rather than instrumenting all caches consistently with
ActiveSupportCacheBytesRead, we were just targeting the specific class being used by the Rails cache; which may or may not the be same as the shared cache, depending on the environment. This PR proposes we just start instrumenting all caches, until we finish this experiment and remove this particular instrumentation entirely.I'm honestly not entirely sure where the flakiness is coming from; the test is failing because it's added an expectation to
Cdo::Metrics.putand something unrelated to the functionality being tested is triggering a cache read, but only sometimes and I'm not sure what. Rather than spending time digging deeper, though, I think we don't need to be adding these expectations as all.Alternatively, we could skip instrumentation of the cache entirely in test. That might be better in the long run, since other tests which may have more reason to inspect metrics might encounter the same problem. But because we haven't seen any yet and because this instrumentation is intended to be temporary anyway, I propose we leave it.
Thoughts? Concerns? Other ideas? Thanks!
Links
Slack thread