From a2dd2591e7f2f97ade1e05bb26947a26d2040f14 Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Sun, 8 Oct 2017 14:07:50 -0400 Subject: [PATCH] fix test to support new output format of CLUSTER NODES --- redistest/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/redistest/server.go b/redistest/server.go index bb8f80a..4d813f2 100644 --- a/redistest/server.go +++ b/redistest/server.go @@ -197,8 +197,12 @@ func getClusterNodeIDs(t *testing.T, ports ...string) map[string]string { s := bufio.NewScanner(strings.NewReader(nodes)) for s.Scan() { fields := strings.Fields(s.Text()) + addrField := fields[1] + if ix := strings.Index(addrField, "@"); ix >= 0 { + addrField = addrField[:ix] + } for _, port := range ports { - if fields[1] == "127.0.0.1:"+port { + if addrField == "127.0.0.1:"+port { mapping[port] = fields[0] break }