test(iam): prove the relationship cache against a live Redis (S25 relationship cache plan: 3/3)

Summary

  • Problem: the shared relationship cache has only been tested against a stub store. Nothing shows that two pods really share one entry, that the key has the documented shape and lifetime, or that a stalled Redis falls through to IAM within the store deadline.
  • Impact: the team. Users and operators see nothing change; no production code changes.
  • Change: a Redis integration test for CachingResolver covers four cases. Two decision resolvers over one client make one IAM call and write one key of the shape ar:iam_relationships:decision_v1:<sha256 hex> with a positive PTTL at or below the TTL. An entry lapses with its short TTL and the next read refetches. The decision and verdict instances write two separate keys. A listener that completes the handshake and never replies makes a read fall through within the derived store deadline, with the error counted. test:integration:iam-rig gets a redis:7-alpine service and ARTIFACT_REGISTRY_REDIS_TEST_ADDR, so the file runs there as well as in test:integration. docs/dev/redis-testing.md records why internal/iam stays out of the Redis topology matrix. The changes: list of test:integration:iam-rig now includes internal/redisclient and internal/testutil, the packages the new tests depend on, so an MR that touches only one of them runs the job that covers it.
  • Downsides: test:integration:iam-rig starts one more container. An MR that changes only internal/redisclient does not start test:integration, because its changes: list is shared with the datastore jobs; test:integration:iam-rig and the test:integration:redis-* jobs run on it instead. Cache writes are detached and expire at an absolute time, so the tests poll for the key instead of reading it right after the call. The TTL-lapse test waits about three seconds.

Plan and spec amendments

  • Plan docs/plans/2026-09-15-s25-relationship-cache-key-value-store.md: the Status rows for steps 2 and 3 carry their MR links. Step 2's row was not filled when it merged.
  • Same plan, step 3: the claim that enrolling internal/iam in the Redis matrix would lose coverage on the security mirror is removed. test:integration is changes-gated and the matrix jobs also run on the mirror, so it was false.

Checklist

  • Ran it: ran the four tests three times against a local redis-server 7.0, and the full unit suite is green. The new CI service and its redis alias have not run yet; the two integration jobs on this pipeline are the check.
  • Interfaces and data: none. Test, CI and docs only.
  • Failure: n/a, no production change. The stalled-store test asserts the failure path: the read falls through to IAM within the store deadline and counts one event="error" per failed command.
  • Rollout: n/a, no production change.
  • Hot path: n/a, no production change.
  • Database: n/a, no migration or query change.
  • Security: n/a, no input, route, permission or authentication change. The new service is a CI-only Redis with no data.
  • ADRs: none govern a test or CI service.
  • E2E: no scenario rows; the tests sit below the IAM client.
  • Simplicity: reuses testutil.StartIsolatedRedisClient, testutil.NewStallingRedis and testutil.UniqueKey, with no new helper package. Enrolling the package in the topology matrix was rejected: the store issues single-key GET and SET on a digest that cannot cross a slot, and internal/cache/counter already proves that wrapper shape on all three topologies.

Related to #1279

Edited by David Fernandez

Merge request reports

Loading
Loading