@@ -6,16 +6,14 @@ import (
66 "testing"
77 "time"
88
9+ "github.com/deckhouse/deckhouse/pkg/log"
910 "github.com/stretchr/testify/assert"
10- "github.com/stretchr/testify/require"
1111 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1212 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1313 "k8s.io/apimachinery/pkg/runtime/schema"
1414 "k8s.io/apimachinery/pkg/version"
1515 fakediscovery "k8s.io/client-go/discovery/fake"
1616
17- "github.com/deckhouse/deckhouse/pkg/log"
18-
1917 klient "github.com/flant/kube-client/client"
2018 kemtypes "github.com/flant/shell-operator/pkg/kube_events_manager/types"
2119)
@@ -72,7 +70,9 @@ func Test_MainKubeEventsManager_Run(t *testing.T) {
7270
7371 err := mgr .AddMonitor (monitor )
7472
75- require .NoError (t , err )
73+ if assert .NoError (t , err ) {
74+ assert .Len (t , mgr .Monitors , 1 )
75+ }
7676}
7777
7878// FIXME: sometimes fails, skip for now.
@@ -139,6 +139,7 @@ func Test_MainKubeEventsManager_HandleEvents(t *testing.T) {
139139
140140 // Init() replacement
141141 mgr := NewKubeEventsManager (ctx , kubeClient , log .NewNop ())
142+ mgr .KubeEventCh = make (chan kemtypes.KubeEvent , 10 )
142143
143144 // monitor with 3 namespaces and 4 object names and all event types
144145 monitor := & MonitorConfig {
0 commit comments