mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
tests: deflake CSI forwarding tests
This updates `client.Ready()` so it returns once the client node got registered at the servers. Previously, it returns when the fingerprinters first batch completes, wtihout ensuring that the node is stored in the Raft data. The tests may fail later when it with unknown node errors later. `client.Reedy()` seem to be only called in CSI and some client stats now. This class of bug, assuming client is registered without checking, is a source of flakiness elsewhere. Other tests use other mechanisms for checking node readiness, though not consistently.
This commit is contained in:
@@ -287,7 +287,7 @@ type Client struct {
|
||||
batchNodeUpdates *batchNodeUpdates
|
||||
|
||||
// fpInitialized chan is closed when the first batch of fingerprints are
|
||||
// applied to the node and the server is updated
|
||||
// applied to the node
|
||||
fpInitialized chan struct{}
|
||||
|
||||
// serversContactedCh is closed when GetClientAllocs and runAllocs have
|
||||
@@ -524,7 +524,7 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulProxie
|
||||
|
||||
// wait until drivers are healthy before restoring or registering with servers
|
||||
select {
|
||||
case <-c.Ready():
|
||||
case <-c.fpInitialized:
|
||||
case <-time.After(batchFirstFingerprintsProcessingGrace):
|
||||
logger.Warn("batch fingerprint operation timed out; proceeding to register with fingerprinted plugins so far")
|
||||
}
|
||||
@@ -566,7 +566,7 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulProxie
|
||||
|
||||
// Ready returns a chan that is closed when the client is fully initialized
|
||||
func (c *Client) Ready() <-chan struct{} {
|
||||
return c.fpInitialized
|
||||
return c.serversContactedCh
|
||||
}
|
||||
|
||||
// init is used to initialize the client and perform any setup
|
||||
|
||||
Reference in New Issue
Block a user