mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
unshare cluster, store in each test suite
This commit is contained in:
parent
be290b5904
commit
8723fbaa61
@ -49,9 +49,6 @@ func TestWatchList(t *testing.T) {
|
|||||||
// - update should trigger Modified event
|
// - update should trigger Modified event
|
||||||
// - update that gets filtered should trigger Deleted event
|
// - update that gets filtered should trigger Deleted event
|
||||||
func testWatch(t *testing.T, recursive bool) {
|
func testWatch(t *testing.T, recursive bool) {
|
||||||
ctx, store, cluster := testSetup(t)
|
|
||||||
defer cluster.Terminate(t)
|
|
||||||
|
|
||||||
podFoo := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
podFoo := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||||
podBar := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}}
|
podBar := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}}
|
||||||
|
|
||||||
@ -93,6 +90,7 @@ func testWatch(t *testing.T, recursive bool) {
|
|||||||
trigger: storage.NoTriggerFunc,
|
trigger: storage.NoTriggerFunc,
|
||||||
}}
|
}}
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
|
ctx, store, cluster := testSetup(t)
|
||||||
filter := storage.NewSimpleFilter(tt.filter, tt.trigger)
|
filter := storage.NewSimpleFilter(tt.filter, tt.trigger)
|
||||||
w, err := store.watch(ctx, tt.key, "0", filter, recursive)
|
w, err := store.watch(ctx, tt.key, "0", filter, recursive)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -124,6 +122,7 @@ func testWatch(t *testing.T, recursive bool) {
|
|||||||
}
|
}
|
||||||
w.Stop()
|
w.Stop()
|
||||||
testCheckStop(t, i, w)
|
testCheckStop(t, i, w)
|
||||||
|
cluster.Terminate(t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user