@@ -24,20 +24,23 @@ import (
24
24
25
25
func (suite * MapUpdateSuite ) Test_Update () {
26
26
suite .Run ("Update" , func () {
27
- suite .tmplData .Paths = make ([]string , 0 , 700 )
28
- for i := 0 ; i < 700 ; i ++ {
27
+ n := 700
28
+ suite .tmplData .Paths = make ([]string , 0 , n )
29
+ for i := 0 ; i < n ; i ++ {
29
30
suite .tmplData .Paths = append (suite .tmplData .Paths , strconv .Itoa (i ))
30
31
}
31
32
oldInfo , err := e2e .GetGlobalHAProxyInfo ()
33
+ oldCount , err := e2e .GetHAProxyMapCount ("path-prefix" )
32
34
suite .NoError (err )
33
35
suite .NoError (suite .test .Apply ("config/ingress.yaml.tmpl" , suite .test .GetNS (), suite .tmplData ))
34
36
suite .Require ().Eventually (func () bool {
35
37
newInfo , err := e2e .GetGlobalHAProxyInfo ()
36
38
suite .NoError (err )
37
39
count , err := e2e .GetHAProxyMapCount ("path-prefix" )
38
40
suite .NoError (err )
39
- suite .T ().Logf ("oldInfo.Pid(%s) == newInfo.Pid(%s) && count(%d) == 702" , oldInfo .Pid , newInfo .Pid , count )
40
- return oldInfo .Pid == newInfo .Pid && count == 702 // 700 + default_http-echo_http + pprof
41
+ numOfAddedEntries := count - oldCount + 1 // We add one because there's already an entry at the begining which will be removed
42
+ suite .T ().Logf ("oldInfo.Pid(%s) == newInfo.Pid(%s) && additional path-prefix.count(%d) == %d" , oldInfo .Pid , newInfo .Pid , numOfAddedEntries , n )
43
+ return oldInfo .Pid == newInfo .Pid && numOfAddedEntries == n
41
44
}, e2e .WaitDuration , e2e .TickDuration )
42
45
})
43
46
}
0 commit comments