Do not Errorf during file watcher verification test loop.
This commit is contained in:
parent
44e06a1a1e
commit
d69977c229
|
@ -255,17 +255,22 @@ func TestProvideWithWatch(t *testing.T) {
|
|||
}
|
||||
|
||||
timeout = time.After(time.Second * 1)
|
||||
success := false
|
||||
for !success {
|
||||
var numUpdates, numBackends, numFrontends, numTLSConfs int
|
||||
for {
|
||||
select {
|
||||
case config := <-configChan:
|
||||
success = assert.Len(t, config.Configuration.Backends, test.expectedNumBackend)
|
||||
success = success && assert.Len(t, config.Configuration.Frontends, test.expectedNumFrontend)
|
||||
success = success && assert.Len(t, config.Configuration.TLS, test.expectedNumTLSConf)
|
||||
case <-timeout:
|
||||
t.Errorf("timeout while waiting for config")
|
||||
numUpdates++
|
||||
numBackends = len(config.Configuration.Backends)
|
||||
numFrontends = len(config.Configuration.Frontends)
|
||||
numTLSConfs = len(config.Configuration.TLS)
|
||||
t.Logf("received update #%d: backends %d/%d, frontends %d/%d, TLS configs %d/%d", numUpdates, numBackends, test.expectedNumBackend, numFrontends, test.expectedNumFrontend, numTLSConfs, test.expectedNumTLSConf)
|
||||
|
||||
if numBackends == test.expectedNumBackend && numFrontends == test.expectedNumFrontend && numTLSConfs == test.expectedNumTLSConf {
|
||||
return
|
||||
}
|
||||
case <-timeout:
|
||||
t.Fatal("timeout while waiting for config")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue