Merge pull request #97193 from JornShen/flaky_devicemanager_test

[flaky test] fix devicemanager TestDevicePluginReRegistrationProbeMode failed
This commit is contained in:
Kubernetes Prow Robot 2021-01-05 11:46:21 -08:00 committed by GitHub
commit b37e9a440e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -282,8 +282,8 @@ func setup(t *testing.T, devs []*pluginapi.Device, callback monitorCallback, soc
func setupInProbeMode(t *testing.T, devs []*pluginapi.Device, callback monitorCallback, socketName string, pluginSocketName string) (Manager, <-chan interface{}, *Stub, pluginmanager.PluginManager) {
m, updateChan := setupDeviceManager(t, devs, callback, socketName)
pm := setupPluginManager(t, pluginSocketName, m)
p := setupDevicePlugin(t, devs, pluginSocketName)
pm := setupPluginManager(t, pluginSocketName, m)
return m, updateChan, p, pm
}

View File

@ -100,7 +100,11 @@ func (rc *reconciler) getHandlers() map[string]cache.PluginHandler {
rc.RLock()
defer rc.RUnlock()
return rc.handlers
var copyHandlers = make(map[string]cache.PluginHandler)
for pluginType, handler := range rc.handlers {
copyHandlers[pluginType] = handler
}
return copyHandlers
}
func (rc *reconciler) reconcile() {