@@ -118,17 +118,13 @@ var _ = Describe("Redis Ring", func() {
118
118
Expect (ring .Len (), 2 )
119
119
120
120
wantShard := ring .ShardByName ("ringShardOne" )
121
- ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
122
- defer cancel ()
123
121
ring .SetAddrs (map [string ]string {
124
122
"ringShardOne" : ":" + ringShard1Port ,
125
123
})
126
124
Expect (ring .Len (), 1 )
127
125
gotShard := ring .ShardByName ("ringShardOne" )
128
126
Expect (gotShard ).To (Equal (wantShard ))
129
127
130
- ctx , cancel = context .WithTimeout (context .Background (), 10 * time .Second )
131
- defer cancel ()
132
128
ring .SetAddrs (map [string ]string {
133
129
"ringShardOne" : ":" + ringShard1Port ,
134
130
"ringShardTwo" : ":" + ringShard2Port ,
@@ -154,8 +150,7 @@ var _ = Describe("Redis Ring", func() {
154
150
wantShard2 := ring .ShardByName (shardName2 )
155
151
shardName3 := "ringShardThree"
156
152
shardAddr3 := ":" + ringShard3Port
157
- ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
158
- defer cancel ()
153
+
159
154
ring .SetAddrs (map [string ]string {
160
155
shardName1 : shardAddr1 ,
161
156
shardName2 : shardAddr2 ,
@@ -169,8 +164,6 @@ var _ = Describe("Redis Ring", func() {
169
164
Expect (gotShard2 ).To (Equal (wantShard2 ))
170
165
Expect (gotShard3 ).ToNot (BeNil ())
171
166
172
- ctx , cancel = context .WithTimeout (context .Background (), 10 * time .Second )
173
- defer cancel ()
174
167
ring .SetAddrs (map [string ]string {
175
168
shardName1 : shardAddr1 ,
176
169
shardName2 : shardAddr2 ,
0 commit comments