Skip to content

Commit

Permalink
Close watchers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Dec 22, 2015
1 parent 0cdd2ab commit 2b8854b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/registry/generic/etcd/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ func TestEtcdWatch(t *testing.T) {
}
}
}
wi.Stop()
}

server.Terminate(t)
Expand Down
5 changes: 5 additions & 0 deletions pkg/storage/etcd/etcd_watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func TestWatch(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
defer watching.Stop()

// Test normal case
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
Expand Down Expand Up @@ -292,6 +293,7 @@ func TestWatchEtcdState(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
defer watching.Stop()

endpoint := &api.Endpoints{
ObjectMeta: api.ObjectMeta{Name: "foo"},
Expand Down Expand Up @@ -356,6 +358,7 @@ func TestWatchFromZeroIndex(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
defer watching.Stop()

// marked as modified b/c of concatenation
event := <-watching.ResultChan()
Expand Down Expand Up @@ -391,6 +394,7 @@ func TestWatchListFromZeroIndex(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
defer watching.Stop()

// creates key/foo which should trigger the WatchList for "key"
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
Expand Down Expand Up @@ -423,6 +427,7 @@ func TestWatchListIgnoresRootKey(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
defer watching.Stop()

// creates key/foo which should trigger the WatchList for "key"
err = h.Create(context.TODO(), key, pod, pod, 0)
Expand Down

1 comment on commit 2b8854b

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 10119 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 207 Build time: 00:04:15

Please sign in to comment.