Code change:
timeout := 2 * time.Minute framework.Logf("Waiting up to %v for sourceIp test to be executed", timeout) cmd := fmt.Sprintf(`wget -T 30 -qO- %s:%d | grep client_address`, serviceIp, servicePort) <del> // need timeout mechanism because it may takes more times for iptables to be populated </del> <ins> // Need timeout mechanism because it may takes more times for iptables to be populated. </ins> for start := time.Now(); time.Since(start) < timeout; time.Sleep(2) { stdout, err = framework.RunHostCmd(execPod.Namespace, execPod.Name, cmd) if err != nil { framework.Logf("got err: %v, retry until timeout", err) continue } <ins> // Need to check output because wget -q might omit the error. if strings.TrimSpace(stdout) == "" { framework.Logf("got empty stdout, retry until timeout") continue } </ins> break } ExpectNoError(err) <del> // the stdout return from RunHostCmd seems to come with "n", so TrimSpace is needed // desired stdout in this format: client_address=x.x.x.x </del> <ins> // The stdout return from RunHostCmd seems to come with "n", so TrimSpace is needed. // Desired stdout in this format: client_address=x.x.x.x </ins> outputs := strings.Split(strings.TrimSpace(stdout), "=") <ins> sourceIp := "" </ins> if len(outputs) != 2 { <del> // fail the test if output format is unexpected </del> <ins> // Fail the test if output format is unexpected. </ins> framework.Failf("exec pod returned unexpected stdout format: [%v]n", stdout) <del> return execPodIp, "" </del> <ins> } else { sourceIp = outputs[1] </ins> } <del> return execPodIp, outputs[1] </del> <ins> return execPodIp, sourceIp </ins> }

Related discussion:
text: https://k8s- Failed: [] Services should preserve source pod IP for traffic thru service cluster IP {Kubernetes e2e suite} Happened on a presubmit run in .
Sorry, it is a new e2e test I am still working on. It is not merged yet.
Don't worry about it, our flake detection isn't quite perfect yet :)
[FLAKE-PING] This flaky-test issue would love to have more attention...
[FLAKE-PING] This flaky-test issue would love to have more attention.
This new e2e test has been merged. Let's observe it few more days and close this issue if nothing bad happen.
[FLAKE-PING] This flaky-test issue would love to have more attention.
This does't look like a failure in new test, rather its a generic failure with serviceaccounts.
Thanks for the investigation. Yeah I think it is the serviceaccounts issue. I wonder when could we close this flaky issue. Seems like it is stable if serviceaccounts issue is fixed.
You can close it with a reference to the serviceaccounts issue - do you know the # for that one ?
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Services should preserve source pod IP for traffic thru service cluster IP {Kubernetes e2e suite}
https://k8s- Failed: [] Services should preserve source pod IP for traffic thru service cluster IP {Kubernetes e2e suite}
https://k8s- Failed: [] Services should preserve source pod IP for traffic thru service cluster IP {Kubernetes e2e suite}
https://k8s- Failed: [] Services should preserve source pod IP for traffic thru service cluster IP {Kubernetes e2e suite}
[FLAKE-PING] This flaky-test issue would love to have more attention.
Have a fix for this, I'm now keeping running tests on my own cluster. Will send out PR once verify the fix works.