Skip to content

Commit 633042c

Browse files
committed
refactor: refactor port and host naming conventions for clarity
- Rename `mappedPort01` to `masterPort` and `mappedPort02` to `slavePort` - Update port number for the slave from `6380` to `6382` - Rename `host01` to `masterName` and `host02` to `slaveName` Signed-off-by: appleboy <[email protected]>
1 parent 6a91151 commit 633042c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

redis_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ func TestRedisCluster(t *testing.T) {
170170
redisC, _ := setupRedisCluserContainer(ctx, t)
171171
defer testcontainers.CleanupContainer(t, redisC)
172172

173-
mappedPort01, err := redisC.MappedPort(ctx, "6379")
173+
masterPort, err := redisC.MappedPort(ctx, "6379")
174174
assert.NoError(t, err)
175175

176-
mappedPort02, err := redisC.MappedPort(ctx, "6380")
176+
slavePort, err := redisC.MappedPort(ctx, "6382")
177177
assert.NoError(t, err)
178178

179179
hostIP, err := redisC.Host(ctx)
@@ -183,10 +183,10 @@ func TestRedisCluster(t *testing.T) {
183183
Message: "foo",
184184
}
185185

186-
host01 := fmt.Sprintf("%s:%s", hostIP, mappedPort01)
187-
host02 := fmt.Sprintf("%s:%s", hostIP, mappedPort02)
186+
masterName := fmt.Sprintf("%s:%s", hostIP, masterPort)
187+
slaveName := fmt.Sprintf("%s:%s", hostIP, slavePort)
188188

189-
hosts := []string{host01, host02}
189+
hosts := []string{masterName, slaveName}
190190

191191
w := NewWorker(
192192
WithAddr(strings.Join(hosts, ",")),

0 commit comments

Comments
 (0)