Merge pull request #9789 from mesosphere/plugin-test-race

Fix mesos plugin-test race
This commit is contained in:
Fabio Yeon 2015-06-15 13:04:12 -07:00
commit da02e3059a

View File

@ -120,7 +120,11 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch {
return lw.fakeWatcher, nil return lw.fakeWatcher, nil
}, },
ListFunc: func() (runtime.Object, error) { ListFunc: func() (runtime.Object, error) {
return &lw.list, nil lw.lock.Lock()
defer lw.lock.Unlock()
listCopy, err := api.Scheme.DeepCopy(&lw.list)
return listCopy.(*api.PodList), err
}, },
} }
return &lw return &lw