Merge branch 'v1.7.2' into master
This commit is contained in:
commit
05f052b092
36 changed files with 696 additions and 176 deletions
|
@ -259,16 +259,21 @@ 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)
|
||||
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.Errorf("timeout while waiting for config")
|
||||
return
|
||||
t.Fatal("timeout while waiting for config")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue