Did a thing to make #testing against a #redis cluster in #golang a bit easier for myself, but maybe it's useful for others, too.
https://github.com/erkattak/testcontainers-go-redis-cluster
This is a module for #testcontainers that forms a Redis cluster (with various configuration options) and gives an API to stop/pause/restart nodes in a targeted way.
I needed something to emulate issues with service resiliency when doing sharded Pub/Sub with a Redis cluster run in #kubernetes - specifically with rescheduled nodes.
The redis/go-redis package isn't exactly resilient against underlying topology changes when doing Pub/Sub, and in writing code to make it more resilient, I found that it's difficult to create a cluster with testcontainers without a lot of boilerplate or configuration. So I decided to abstract that part away from the real code I'm writing.
I probably just could've installed redis on my local or ensured that it is available in CI, but both already have #docker and we already used testcontainers a bit in other parts of our service.
https://github.com/erkattak/testcontainers-go-redis-cluster
This is a module for #testcontainers that forms a Redis cluster (with various configuration options) and gives an API to stop/pause/restart nodes in a targeted way.
I needed something to emulate issues with service resiliency when doing sharded Pub/Sub with a Redis cluster run in #kubernetes - specifically with rescheduled nodes.
The redis/go-redis package isn't exactly resilient against underlying topology changes when doing Pub/Sub, and in writing code to make it more resilient, I found that it's difficult to create a cluster with testcontainers without a lot of boilerplate or configuration. So I decided to abstract that part away from the real code I'm writing.
I probably just could've installed redis on my local or ensured that it is available in CI, but both already have #docker and we already used testcontainers a bit in other parts of our service.
