Commit 2b8854ba authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Close watchers in tests

parent 0cdd2aba
...@@ -605,6 +605,7 @@ func TestEtcdWatch(t *testing.T) { ...@@ -605,6 +605,7 @@ func TestEtcdWatch(t *testing.T) {
} }
} }
} }
wi.Stop()
} }
server.Terminate(t) server.Terminate(t)
......
...@@ -246,6 +246,7 @@ func TestWatch(t *testing.T) { ...@@ -246,6 +246,7 @@ func TestWatch(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %v", err) t.Fatalf("Unexpected error: %v", err)
} }
defer watching.Stop()
// Test normal case // Test normal case
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}} pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
...@@ -292,6 +293,7 @@ func TestWatchEtcdState(t *testing.T) { ...@@ -292,6 +293,7 @@ func TestWatchEtcdState(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %v", err) t.Fatalf("Unexpected error: %v", err)
} }
defer watching.Stop()
endpoint := &api.Endpoints{ endpoint := &api.Endpoints{
ObjectMeta: api.ObjectMeta{Name: "foo"}, ObjectMeta: api.ObjectMeta{Name: "foo"},
...@@ -356,6 +358,7 @@ func TestWatchFromZeroIndex(t *testing.T) { ...@@ -356,6 +358,7 @@ func TestWatchFromZeroIndex(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %v", err) t.Fatalf("Unexpected error: %v", err)
} }
defer watching.Stop()
// marked as modified b/c of concatenation // marked as modified b/c of concatenation
event := <-watching.ResultChan() event := <-watching.ResultChan()
...@@ -391,6 +394,7 @@ func TestWatchListFromZeroIndex(t *testing.T) { ...@@ -391,6 +394,7 @@ func TestWatchListFromZeroIndex(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %v", err) t.Fatalf("Unexpected error: %v", err)
} }
defer watching.Stop()
// creates key/foo which should trigger the WatchList for "key" // creates key/foo which should trigger the WatchList for "key"
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}} pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
...@@ -423,6 +427,7 @@ func TestWatchListIgnoresRootKey(t *testing.T) { ...@@ -423,6 +427,7 @@ func TestWatchListIgnoresRootKey(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %v", err) t.Fatalf("Unexpected error: %v", err)
} }
defer watching.Stop()
// creates key/foo which should trigger the WatchList for "key" // creates key/foo which should trigger the WatchList for "key"
err = h.Create(context.TODO(), key, pod, pod, 0) err = h.Create(context.TODO(), key, pod, pod, 0)
......
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