Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing: add test cases to verify cache invalidation for LocalPolicyR…
…etriever At time of creation these tests fail with: ``` === RUN TestCacheInvalidationLocalPolicyRetrieverIfPolicyIsChanged ./cmd/policy-retrieval_test.go:271: Policy arn:aws:iam::000000000000:role/cache-invalidation2 was updated at 2024-12-14 15:53:10.511022552 +0100 CET m=+0.003016620 and now 2024-12-14 15:53:15.520616568 +0100 CET m=+5.012610662 policy manager still sees { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "*", "Condition" : { "StringLike" : { "aws:RequestedRegion": "tst-1" } } } ] } --- FAIL: TestCacheInvalidationLocalPolicyRetrieverIfPolicyIsChanged (5.01s) ``` and ``` === RUN TestCacheInvalidationLocalPolicyRetrieverIfPolicyIsChanged ./cmd/policy-retrieval_test.go:271: Policy arn:aws:iam::000000000000:role/cache-invalidation2 was updated at 2024-12-14 15:53:10.511022552 +0100 CET m=+0.003016620 and now 2024-12-14 15:53:15.520616568 +0100 CET m=+5.012610662 policy manager still sees { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "*", "Condition" : { "StringLike" : { "aws:RequestedRegion": "tst-1" } } } ] } --- FAIL: TestCacheInvalidationLocalPolicyRetrieverIfPolicyIsChanged (5.01s) ``` These tests are expected to pass with proper cache invalidation and they also would take less long. If cache invalidation would take longer than 5 seconds that variable can be further tuned but a higher value would also impact user experience.
- Loading branch information