Commit 8723fbaa authored by Hongchao Deng's avatar Hongchao Deng

unshare cluster, store in each test suite

parent be290b59
......@@ -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)
}
}
......
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