Skip to content

Commit dc04095

Browse files
committed
test: improve Redis cluster setup and endpoint configuration
- Add setup and cleanup of two Redis containers in the `TestRedisCluster` function - Replace `host01` and `host02` with `endpoint01` and `endpoint02` in the `hosts` slice Signed-off-by: appleboy <[email protected]>
1 parent 338e31f commit dc04095

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

redis_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,19 @@ func TestCustomFuncAndWait(t *testing.T) {
143143

144144
func TestRedisCluster(t *testing.T) {
145145
t.Helper()
146+
147+
ctx := context.Background()
148+
redisC01, endpoint01 := setupRedisContainer(ctx, t)
149+
defer testcontainers.CleanupContainer(t, redisC01)
150+
151+
redisC02, endpoint02 := setupRedisContainer(ctx, t)
152+
defer testcontainers.CleanupContainer(t, redisC02)
153+
146154
m := &mockMessage{
147155
Message: "foo",
148156
}
149157

150-
hosts := []string{host01, host02}
158+
hosts := []string{endpoint01, endpoint02}
151159

152160
w := NewWorker(
153161
WithAddr(strings.Join(hosts, ",")),

0 commit comments

Comments
 (0)