do not assert on random behaviour

This commit is contained in:
Elvin Efendi 2018-05-16 19:19:38 -04:00
parent 2eb0286c8a
commit c7de5a5bf6

View file

@ -18,7 +18,6 @@ package lua
import (
"fmt"
"math/rand"
"net/http"
"regexp"
"strings"
@ -253,22 +252,6 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() {
newUpstreamName := hostnamePattern.FindAllStringSubmatch(body, -1)[0][1]
Expect(newUpstreamName).Should(Equal(upstreamName))
}
notEqualFound := false
for i := 0; i < 5; i++ {
resp, body, errs = gorequest.New().
Get(fmt.Sprintf("%s?completely-different-path=%f", f.IngressController.HTTPURL, rand.Float64())).
Set("Host", "foo.com").
End()
Expect(len(errs)).Should(Equal(0))
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
anotherUpstreamName := hostnamePattern.FindAllStringSubmatch(body, -1)[0][1]
notEqualFound = anotherUpstreamName != upstreamName
if notEqualFound {
break
}
}
Expect(notEqualFound).Should(Equal(true))
})
Context("when session affinity annotation is present", func() {