From 4dc0f24b38a74b63ddff59180c4c624c89a06e88 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 14 Mar 2018 20:54:48 +0100 Subject: [PATCH] backend/tests: Drain reader before returning error --- internal/backend/test/tests.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/backend/test/tests.go b/internal/backend/test/tests.go index caf0a9ac7..dec1e0bee 100644 --- a/internal/backend/test/tests.go +++ b/internal/backend/test/tests.go @@ -147,6 +147,10 @@ func (s *Suite) TestLoad(t *testing.T) { } err = b.Load(context.TODO(), handle, 0, 0, func(rd io.Reader) error { + _, err := io.Copy(ioutil.Discard, rd) + if err != nil { + t.Fatal(err) + } return errors.Errorf("deliberate error") }) if err == nil {