Merge pull request #121494 from aojea/fix/flake-unit-test

Fix/flake TestNewManagerImplStartProbeMode  unit test
This commit is contained in:
Kubernetes Prow Robot
2023-10-25 06:57:04 +02:00
committed by GitHub
2 changed files with 6 additions and 4 deletions

View File

@@ -236,12 +236,12 @@ func (m *ManagerImpl) PluginDisconnected(resourceName string) {
m.mutex.Lock() m.mutex.Lock()
defer m.mutex.Unlock() defer m.mutex.Unlock()
if _, exists := m.endpoints[resourceName]; exists { if ep, exists := m.endpoints[resourceName]; exists {
m.markResourceUnhealthy(resourceName) m.markResourceUnhealthy(resourceName)
klog.V(2).InfoS("Endpoint became unhealthy", "resourceName", resourceName, "endpoint", m.endpoints[resourceName]) klog.V(2).InfoS("Endpoint became unhealthy", "resourceName", resourceName, "endpoint", ep)
}
m.endpoints[resourceName].e.setStopTime(time.Now()) ep.e.setStopTime(time.Now())
}
} }
// PluginListAndWatchReceiver receives ListAndWatchResponse from a device plugin // PluginListAndWatchReceiver receives ListAndWatchResponse from a device plugin

View File

@@ -69,8 +69,10 @@ func (c *client) Connect() error {
klog.ErrorS(err, "Unable to connect to device plugin client with socket path", "path", c.socket) klog.ErrorS(err, "Unable to connect to device plugin client with socket path", "path", c.socket)
return err return err
} }
c.mutex.Lock()
c.grpc = conn c.grpc = conn
c.client = client c.client = client
c.mutex.Unlock()
return c.handler.PluginConnected(c.resource, c) return c.handler.PluginConnected(c.resource, c)
} }