From 8723fbaa61a032e8395b4f60a272de1dbc3430d1 Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Fri, 2 Sep 2016 15:04:23 -0700 Subject: [PATCH] unshare cluster, store in each test suite --- pkg/storage/etcd3/watcher_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/storage/etcd3/watcher_test.go b/pkg/storage/etcd3/watcher_test.go index 34bdd159162..8781750e031 100644 --- a/pkg/storage/etcd3/watcher_test.go +++ b/pkg/storage/etcd3/watcher_test.go @@ -49,9 +49,6 @@ func TestWatchList(t *testing.T) { // - update should trigger Modified event // - update that gets filtered should trigger Deleted event func testWatch(t *testing.T, recursive bool) { - ctx, store, cluster := testSetup(t) - defer cluster.Terminate(t) - podFoo := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}} podBar := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}} @@ -93,6 +90,7 @@ func testWatch(t *testing.T, recursive bool) { trigger: storage.NoTriggerFunc, }} for i, tt := range tests { + ctx, store, cluster := testSetup(t) filter := storage.NewSimpleFilter(tt.filter, tt.trigger) w, err := store.watch(ctx, tt.key, "0", filter, recursive) if err != nil { @@ -124,6 +122,7 @@ func testWatch(t *testing.T, recursive bool) { } w.Stop() testCheckStop(t, i, w) + cluster.Terminate(t) } }