openwallet-foundation / openwallet-foundation/acapy-plugins
Intermittent fail in Integration Tests for the cache_redis plugin because Redis cluster race condition
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10
- Forks
- 47
- Avg merge
- 13h 22m
- Merged PRs (30d)
- 12
Description
Claude summary and actions. I'll copy/paste this into Claude Code to fix the issue in a separate PRs from weekly updates.
Summary
redis_events integration tests intermittently fail with test_deliverer_pulls_messages_from_queue_and_sends_them and test_relay_has_keys_in_recip_key_uid_map failing. Root cause is a startup race in redis_events/integration/docker-compose.yml, unrelated to any plugin code change.
Evidence
CI run: https://github.com/openwallet-foundation/acapy-plugins/actions/runs/30927035404/job/92051904487
faberthrows at startup:
This kills itsacapy_agent.transport.error.TransportError: No Redis instance setup, All slots are not covered after query all startup_nodes. 10922 of 16384 covered...InboundTransportManager/OutboundTransportManagerstartup tasks.test_deliverer_pulls_messages_from_queue_and_sends_themfails (assert 1 == 2) — a message pushed toacapy_outboundis never drained/delivered.test_relay_has_keys_in_recip_key_uid_mapfails (assert {}) —relaynever wrote to Redis.- All 6 Redis Cluster nodes actually reach
Cluster state changed: okfine in the logs — the cluster forms correctly, just not before dependent services query it. - Every other plugin's integration tests passed in the same run; this is isolated to
redis_events.
Root cause
In redis_events/integration/docker-compose.yml:
- The
redis-clusterservice runsredis-cli --cluster create ...in its own container to form the 6-node cluster. Slot assignment + gossip propagation takes a couple of seconds after the nodes' ports open (observed: ports open at T+0s,Cluster state changed: okon all nodes only by ~T+2s). relay,deliverer, andfabergate their startup viadocker-compose-waitonWAIT_HOSTS=redis-node-3:6379(plus a fixedWAIT_BEFOREof 5–10s). This only checks that one node's TCP port is open, not that the cluster has finished forming with full 16384-slot coverage.- Nothing gates
relay/deliverer/faberon theredis-clustercontainer'sredis-cli --cluster createstep actually completing (nodepends_on: condition: service_completed_successfully).
Normally the fixed WAIT_BEFORE delay provides enough margin, but under CI resource contention the cluster-formation step can run slower than usual, and the race is lost intermittently.
redis-py (the redis package) version was unchanged in the triggering PR — only cryptography was bumped in redis_events/poetry.lock — so this is not a dependency-version regression.
Suggested fix direction
Make relay, deliverer, and faber actually wait for the cluster to be healthy rather than for one port to be open:
- Drop
tail -f /dev/nullfrom theredis-clusterservice's command so it exits afterredis-cli --cluster createsucceeds, and changerelay/deliverer/fabertodepends_on: redis-cluster: condition: service_completed_successfully; or - Add a script/healthcheck that polls
redis-cli --cluster check <host>:<port>(orCLUSTER INFOforcluster_state:okacross all 6 nodes) before those services proceed.
File: redis_events/integration/docker-compose.yml
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with redis_events/integration/docker-compose.yml and run the redis_events integration tests, especially test_deliverer_pulls_messages_from_queue_and_sends_them and test_relay_has_keys_in_recip_key_uid_map. Trace the startup ordering for redis-cluster, relay, deliverer, and faber, then verify the tests pass reliably under delayed cluster formation without intermittent Redis startup errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, python, redis
- Domain
- devops, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100