Fix status tests

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-03-10 13:46:44 -03:00
parent 0a39425e8f
commit 476d0106d6
No known key found for this signature in database
GPG key ID: 786136016A8BA02A

View file

@ -287,12 +287,16 @@ func TestStatusActions(t *testing.T) {
Client: buildSimpleClientSet(), Client: buildSimpleClientSet(),
PublishService: "", PublishService: "",
IngressLister: buildIngressLister(), IngressLister: buildIngressLister(),
DefaultIngressClass: "nginx",
IngressClass: "",
UpdateStatusOnShutdown: true, UpdateStatusOnShutdown: true,
} }
// create object // create object
fkSync := NewStatusSyncer(c) fkSync := NewStatusSyncer(&k8s.PodInfo{
Name: "foo_base_pod",
Namespace: apiv1.NamespaceDefault,
Labels: map[string]string{
"lable_sig": "foo_pod",
},
}, c)
if fkSync == nil { if fkSync == nil {
t.Fatalf("expected a valid Sync") t.Fatalf("expected a valid Sync")
} }
@ -300,7 +304,10 @@ func TestStatusActions(t *testing.T) {
fk := fkSync.(statusSync) fk := fkSync.(statusSync)
// start it and wait for the election and syn actions // start it and wait for the election and syn actions
go fk.Run() stopCh := make(chan struct{})
defer close(stopCh)
go fk.Run(stopCh)
// wait for the election // wait for the election
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
// execute sync // execute sync