@@ -6,12 +6,13 @@ import (
66 "sync"
77 "testing"
88
9- "github.com/deckhouse/deckhouse/pkg/log"
109 . "github.com/onsi/gomega"
1110 "github.com/stretchr/testify/assert"
1211 corev1 "k8s.io/api/core/v1"
1312 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1413
14+ "github.com/deckhouse/deckhouse/pkg/log"
15+
1516 "github.com/flant/kube-client/fake"
1617 "github.com/flant/kube-client/manifest"
1718 kemtypes "github.com/flant/shell-operator/pkg/kube_events_manager/types"
@@ -75,13 +76,6 @@ func Test_Monitor_should_handle_dynamic_ns_events(t *testing.T) {
7576 // create new ns with matching labels and then create new ConfigMap.
7677 createNsWithLabels (fc , "test-ns-1" , map [string ]string {"test-label" : "" })
7778
78- // Wait until informers appears.
79- g .Eventually (func () bool {
80- _ , exists := mon .VaryingInformers .Load ("test-ns-1" )
81- return exists
82- }, "5s" , "10ms" ).
83- Should (BeTrue (), "Should create informer for new namespace" )
84-
8579 createCM (fc , "test-ns-1" , testCM ("cm-1" ))
8680
8781 // Should update snapshot with new objects.
@@ -120,13 +114,6 @@ func Test_Monitor_should_handle_dynamic_ns_events(t *testing.T) {
120114 // Create new ns with labels and cm there.
121115 createNsWithLabels (fc , "test-ns-2" , map [string ]string {"test-label" : "" })
122116
123- // Monitor should create new configmap informer for new namespace.
124- g .Eventually (func () bool {
125- _ , exists := mon .VaryingInformers .Load ("test-ns-2" )
126- return exists
127- }, "5s" , "10ms" ).
128- Should (BeTrue (), "Should create informer for ns/test-ns-2" )
129-
130117 // Create new ConfigMap after Synchronization.
131118 createCM (fc , "test-ns-2" , testCM ("cm-2-1" ))
132119
@@ -145,13 +132,6 @@ func Test_Monitor_should_handle_dynamic_ns_events(t *testing.T) {
145132
146133 // Add non-matched Namespace.
147134 createNsWithLabels (fc , "test-ns-non-matched" , map [string ]string {"non-matched-label" : "" })
148-
149- // Monitor should create new configmap informer for new namespace.
150- g .Eventually (func () bool {
151- _ , exists := mon .VaryingInformers .Load ("test-ns-non-matched" )
152- return exists
153- }, "5s" , "10ms" ).
154- ShouldNot (BeTrue (), "Should not create informer for non-mathed Namespace" )
155135}
156136
157137func createNsWithLabels (fc * fake.Cluster , name string , labels map [string ]string ) {
0 commit comments