Commit d21309d1 authored by rht's avatar rht

Fix 'ctx, _' to have explicit cancel

License: MIT
Signed-off-by: default avatarrht <rhtbot@gmail.com>
parent 946e3697
...@@ -202,7 +202,8 @@ func TestNotFound(t *testing.T) { ...@@ -202,7 +202,8 @@ func TestNotFound(t *testing.T) {
} }
// long timeout to ensure timing is not at play. // long timeout to ensure timing is not at play.
ctx, _ = context.WithTimeout(ctx, time.Second*20) ctx, cancel := context.WithTimeout(ctx, time.Second*20)
defer cancel()
v, err := d.GetValue(ctx, key.Key("hello")) v, err := d.GetValue(ctx, key.Key("hello"))
log.Debugf("get value got %v", v) log.Debugf("get value got %v", v)
if err != nil { if err != nil {
...@@ -274,7 +275,8 @@ func TestLessThanKResponses(t *testing.T) { ...@@ -274,7 +275,8 @@ func TestLessThanKResponses(t *testing.T) {
}) })
} }
ctx, _ = context.WithTimeout(ctx, time.Second*30) ctx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()
if _, err := d.GetValue(ctx, key.Key("hello")); err != nil { if _, err := d.GetValue(ctx, key.Key("hello")); err != nil {
switch err { switch err {
case routing.ErrNotFound: case routing.ErrNotFound:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment