mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #19046 from thockin/e2e-svcs-not-round-robin
Auto commit by PR queue bot
This commit is contained in:
commit
3644492e66
@ -1335,9 +1335,11 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod
|
|||||||
defer func() {
|
defer func() {
|
||||||
deletePodOrFail(c, ns, execPodName)
|
deletePodOrFail(c, ns, execPodName)
|
||||||
}()
|
}()
|
||||||
|
// Loop a bunch of times - the proxy is randomized, so we want a good
|
||||||
|
// chance of hitting each backend at least once.
|
||||||
command := fmt.Sprintf(
|
command := fmt.Sprintf(
|
||||||
"for i in $(seq 1 %d); do wget -q -T 1 -O - http://%s:%d || true; echo; done",
|
"for i in $(seq 1 %d); do wget -q -T 1 -O - http://%s:%d || true; echo; done",
|
||||||
3*len(expectedPods), serviceIP, servicePort)
|
50*len(expectedPods), serviceIP, servicePort)
|
||||||
|
|
||||||
commands := []func() string{
|
commands := []func() string{
|
||||||
// verify service from node
|
// verify service from node
|
||||||
@ -1367,9 +1369,7 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod
|
|||||||
for _, cmdFunc := range commands {
|
for _, cmdFunc := range commands {
|
||||||
passed := false
|
passed := false
|
||||||
pods := []string{}
|
pods := []string{}
|
||||||
// Retry cmdFunc for upto 5 minutes.
|
// Retry cmdFunc for a while
|
||||||
// TODO: make this stricter. Ideally hitting a Service with n pods n
|
|
||||||
// times should round robing to each pod, and one pass should suffice.
|
|
||||||
for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) {
|
for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) {
|
||||||
pods = strings.Split(strings.TrimSpace(cmdFunc()), "\n")
|
pods = strings.Split(strings.TrimSpace(cmdFunc()), "\n")
|
||||||
// Uniq pods before the sort because inserting them into a set
|
// Uniq pods before the sort because inserting them into a set
|
||||||
|
Loading…
Reference in New Issue
Block a user