improve test cov for auth caches#33939
Conversation
|
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
674eeae to
67399c0
Compare
67399c0 to
1f4f0f1
Compare
There was a problem hiding this comment.
Should this be in a _test file?
There was a problem hiding this comment.
I could move it now, but it will need to be moved back once we start having the cache enabled across more auth tests as some of the other elements of helpers.go can't function in the context of the cache without this helper. I think the "real" answer is that helpers.go probably needs to be a separate package only imported by _test.go files, but that seems out of scope for this PR.
1f4f0f1 to
b5b28cb
Compare
|
@fspmarshall See the table below for backport results.
|
Improves some cache-related auth server tests. While looking into why a recent bug snuck past our test coverage I discovered that most of our test coverage in
lib/authdoesn't have the auth cache enabled. In fact, almost all tests inlib/authfail if the auth cache is enabled (not because of undiscovered bugs, tests just need to be written differently if there is a slight delay between resources being written and becoming readable).This PR starts the work of making caching enabled for
lib/authtests, but only actually enables them for the unified resource cache tests. A decent amount of additional work is needed to ensure that the rest of the existing tests are updated and, importantly, that doing so does not create too onerous a burden on test authors going forward.The
flushCachehelper in this PR is an experiment. I'm working on a more 'correct' way to implement a cache flush operation so that the rest of tests can be updated without needing to be reworked and/or needing to wrap everything inrequire.Eventuallycalls. For the time being, this PR will close the aforementioned hole in our coverage by ensuring that incompatibilities between the primary auth cache and the unified resource cache are caught by our test coverage.