Commit 31d09f52 authored by Wojciech Tyczynski's avatar Wojciech Tyczynski Committed by GitHub

Merge pull request #28948 from soltysh/issue28941

Fix issue with closing channels in job controller tests
parents 06939c57 fd76f71f
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"testing" "testing"
"time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
...@@ -32,6 +33,7 @@ import ( ...@@ -32,6 +33,7 @@ import (
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/util/rand" "k8s.io/kubernetes/pkg/util/rand"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
) )
...@@ -718,7 +720,8 @@ func TestWatchPods(t *testing.T) { ...@@ -718,7 +720,8 @@ func TestWatchPods(t *testing.T) {
// and make sure it hits the sync method for the right job. // and make sure it hits the sync method for the right job.
stopCh := make(chan struct{}) stopCh := make(chan struct{})
defer close(stopCh) defer close(stopCh)
go manager.Run(1, stopCh) go manager.internalPodInformer.Run(stopCh)
go wait.Until(manager.worker, 10*time.Millisecond, stopCh)
pods := newPodList(1, api.PodRunning, testJob) pods := newPodList(1, api.PodRunning, testJob)
testPod := pods[0] testPod := pods[0]
......
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