Fix context usage in backend tests

Found by go vet. This is also the only complaint is has.
This commit is contained in:
greatroar 2020-03-03 17:53:24 +01:00
parent 9790d8ce1c
commit df66daa5c9

View file

@ -412,13 +412,11 @@ func (s *Suite) TestListCancel(t *testing.T) {
})
t.Run("Timeout", func(t *testing.T) {
ctx, cancel := context.WithCancel(context.TODO())
defer cancel()
// rather large timeout, let's try to get at least one item
timeout := time.Second
ctxTimeout, _ := context.WithTimeout(ctx, timeout)
ctxTimeout, cancel := context.WithTimeout(context.TODO(), timeout)
defer cancel()
i := 0
// pass in a context with a timeout