File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,6 @@ func TestCanGetKeyspaces(t *testing.T) {
238
238
conf := config
239
239
defer resetConfig (conf )
240
240
241
- ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
242
- defer cancel ()
243
-
244
241
clusterInstance , err := startCluster ()
245
242
require .NoError (t , err )
246
243
defer clusterInstance .TearDown ()
@@ -251,16 +248,15 @@ func TestCanGetKeyspaces(t *testing.T) {
251
248
}
252
249
}()
253
250
251
+ ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
252
+ defer cancel ()
254
253
assertGetKeyspaces (ctx , t , clusterInstance )
255
254
}
256
255
257
256
func TestExternalTopoServerConsul (t * testing.T ) {
258
257
conf := config
259
258
defer resetConfig (conf )
260
259
261
- ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
262
- defer cancel ()
263
-
264
260
// Start a single consul in the background.
265
261
cmd , serverAddr := startConsul (t )
266
262
defer func () {
@@ -279,6 +275,8 @@ func TestExternalTopoServerConsul(t *testing.T) {
279
275
require .NoError (t , err )
280
276
defer cluster .TearDown ()
281
277
278
+ ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
279
+ defer cancel ()
282
280
assertGetKeyspaces (ctx , t , cluster )
283
281
}
284
282
You can’t perform that action at this time.
0 commit comments