Skip to content

Commit 6a91151

Browse files
committed
refactor: switch Redis cluster waiting strategy to execution-based
- Change the Redis cluster waiting strategy from log-based to execution-based using `redis-cli` command Signed-off-by: appleboy <[email protected]>
1 parent 9e4080b commit 6a91151

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

redis_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ func setupRedisCluserContainer(ctx context.Context, t *testing.T) (testcontainer
4444
"6383/tcp",
4545
"6384/tcp",
4646
},
47-
WaitingFor: wait.ForLog("Sending CLUSTER MEET messages to join the cluster"),
47+
WaitingFor: wait.NewExecStrategy(
48+
[]string{"redis-cli", "-h", "localhost", "-p", "6379", "cluster", "info"},
49+
),
4850
}
4951
redisC, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
5052
ContainerRequest: req,

0 commit comments

Comments
 (0)