From 3fefac17b25dcc9e3c93f93e52cefd8db5828922 Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Mon, 28 Aug 2017 16:31:36 +0900 Subject: [PATCH] integration: clean up resources in error paths of TestV3WatchFromCurrentRevision Current error paths of TestV3WatchFromCurrentRevision don't clean the used resources including goroutines. Because go's tests are executed continuously in a single process, the leaked goroutines makes error logs bloated like the below case: https://jenkins-etcd-public.prod.coreos.systems/job/etcd-coverage/2143/ This commit lets the error paths clean the resources. --- integration/v3_watch_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration/v3_watch_test.go b/integration/v3_watch_test.go index c6570d0c2..92fc98ef3 100644 --- a/integration/v3_watch_test.go +++ b/integration/v3_watch_test.go @@ -223,20 +223,24 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { cresp, err := wStream.Recv() if err != nil { t.Errorf("#%d: wStream.Recv error: %v", i, err) + clus.Terminate(t) continue } if !cresp.Created { t.Errorf("#%d: did not create watchid, got %+v", i, cresp) + clus.Terminate(t) continue } if cresp.Canceled { t.Errorf("#%d: canceled watcher on create %+v", i, cresp) + clus.Terminate(t) continue } createdWatchId := cresp.WatchId if cresp.Header == nil || cresp.Header.Revision != 1 { t.Errorf("#%d: header revision got +%v, wanted revison 1", i, cresp) + clus.Terminate(t) continue }