kubelet: Fix racy kubelet tests.

Add fakePodWorkders to run syncPod() in serial for testing.
This commit is contained in:
Yifan Gu
2015-05-08 11:48:26 -07:00
parent 5fcf5911fa
commit 52af792852
4 changed files with 131 additions and 94 deletions

View File

@@ -28,6 +28,12 @@ import (
"github.com/golang/glog"
)
// PodWorkers is an abstract interface for testability.
type PodWorkers interface {
UpdatePod(pod *api.Pod, mirrorPod *api.Pod, updateComplete func())
ForgetNonExistingPodWorkers(desiredPods map[types.UID]empty)
}
type syncPodFnType func(*api.Pod, *api.Pod, kubecontainer.Pod) error
type podWorkers struct {