Change:
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug /priority failing-test /sig network What happened: From https://k8s-, seems to be broken right after they were by Example error message: and Anything else we need to know?: Is it as expected?
Oct 11 16:37:49.106: test session affinity, cost time: 1m31.742990485s This is a mistake. Sorry for my debug lines sneak in. I was just wondering why this test case doesn't run in upstream CI, so I this debug line. Now, I see because this test case only runs in . Oct 11 16:39:42.406: Expect endpoints: map[], got: map[netserver-1:{}] This check failed unexpectedly, let me try to find out why. I am working on it and will let you know soon when I have some updates.
Thanks. These two tests don't run on pull jobs as they are marked as , though https://k8s-, https://k8s- (and other CIs that include ) would have them running.
Do you mean when I raise a PR, these test cases will not be triggered? My question is how can I make sure my follow-up PR can fix this bug? Where can I access the log message when I raise a new PR?
Can I see the updated test results via directly visiting https://k8s-, https://k8s-
Yep, that is the current behavior. A hacky way to make it run on PR --- add a temporary commit to remove the word from test name so some pull jobs ( I think?) will run it. And you could view logs by clicking the button.
Nope, this CI only includes changes that are merged. It is basically a cronjob that runs tests against head.

Discussion:
Failf("Failed to find expected endpoints:nTries %dnCommand %vnretrieved %vnexpected %vn", maxTries, cmd, eps, expectedEps) } <del> func (config *NetworkingTestConfig) GetEndpointsFromTestContainer(protocol, targetIP string, targetPort, maxTries, minTries int) (sets.String, error) { return config.GetEndpointsFromContainer(protocol, config.TestContainerPod.Status.PodIP, targetIP, TestContainerHttpPort, targetPort, maxTries, minTries) </del> <ins> func (config *NetworkingTestConfig) GetEndpointsFromTestContainer(protocol, targetIP string, targetPort, tries int) (sets.String, error) { return config.GetEndpointsFromContainer(protocol, config.TestContainerPod.Status.PodIP, targetIP, TestContainerHttpPort, targetPort, tries) </ins> } <del> func (config *NetworkingTestConfig) GetEndpointsFromContainer(protocol, containerIP, targetIP string, containerHttpPort, targetPort, maxTries, minTries int) (sets.String, error) { </del> <ins> // GetEndpointsFromContainer executes a curl via kubectl exec in a test container, // which might then translate to a tcp or udp request based on the protocol argument // in the url. // - tries is the maximum number of curl attempts. If this many attempts pass and //   we don't see any endpoints, the test fails. func (config *NetworkingTestConfig) GetEndpointsFromContainer(protocol, containerIP, targetIP string, containerHttpPort, targetPort, tries int) (sets.String, error) { </ins> cmd := fmt.Sprintf("curl -q -s 'http://%s:%d/dial?request=hostName&protocol=%s&host=%s&port=%d&tries=1'", containerIP, containerHttpPort,

eps := sets.NewString() <del> for i := 0; i < maxTries; i++ { </del> <ins> for i := 0; i < tries; i++ { </ins> stdout, stderr, err := config.f.ExecShellInPodWithFullOutput(config.HostTestContainerPod.Name, cmd) if err != nil { // A failure to kubectl exec counts as a try, not a hard fail.

// we confirm unreachability. Logf("Failed to execute %q: %v, stdout: %q, stderr: %q", cmd, err, stdout, stderr) } else { <ins> Logf("maxTries: %d, in try: %d, stdout: %v, stderr: %v", tries, i, stdout, stderr) </ins> var output map[string][]string if err := json.Unmarshal([]byte(stdout), &output); err != nil { Logf("WARNING: Failed to unmarshal curl response. Cmd %v run in %v, output: %s, err: %v",

eps.Insert(trimmed) } } <del> return eps, nil </del> <ins> // Return immediately when we successfully fetch endpoints if len(eps) > 0 { return eps, nil } // TODO: get rid of this delay #36281 time.Sleep(hitEndpointRetryDelay) </ins> } } <del> return nil, fmt.Errorf("Failed to get endpoints:nTries %dnCommand %vn", minTries, cmd) </del> <ins> return nil, fmt.Errorf("error getting endpoints:nTries %dnCommand %vn", tries, cmd) </ins> } // DialFromNode executes a tcp or udp request based on protocol via kubectl exec

import ( "fmt" "net/http" <del> "time" </del> "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets"

updateSessionAffinity := func(svc *v1.Service) { svc.Spec.SessionAffinity = v1.ServiceAffinityClientIP } <del> framework.UpdateService(f.ClientSet, config.NodePortService.Namespace, config.NodePortService.Name, updateSessionAffinity) firstEndpoints, err := config.GetEndpointsFromTestContainer("http", config.ClusterIP, framework.ClusterHttpPort, config.MaxTries, 0) </del> <ins> _, err := framework.UpdateService(f.ClientSet, config.NodePortService.Namespace, config.NodePortService.Name, updateSessionAffinity) </ins> if err != nil { <del> framework.Failf("Unable to get endpoints from test containers: %v", err) </del> <ins> framework.Failf("Failed to update service session affinity, error: %v", err) </ins> } <ins> // Fetch first endpoints when visiting service firstEndpoints, err := config.GetEndpointsFromTestContainer("http", config.ClusterIP, framework.ClusterHttpPort, config.MaxTries) if err != nil { framework.Failf("Unable to get endpoints from test container: %v", err) } // Check if first endpoints are equal to endpoints which are fetched later </ins> for i := 0; i < framework.SessionAffinityChecks; i++ { <del> eps, err := config.GetEndpointsFromTestContainer("http", config.ClusterIP, framework.ClusterHttpPort, config.MaxTries, 0) </del> <ins> eps, err := config.GetEndpointsFromTestContainer("http", config.ClusterIP, framework.ClusterHttpPort, config.MaxTries) </ins> if err != nil { <del> framework.Failf("Unable to get endpoints from test containers: %v", err) </del> <ins> framework.Failf("Unable to get endpoints from test container: %v", err) </ins> } if !eps.Equal(firstEndpoints) { framework.Failf("Expect endpoints: %v, got: %v", firstEndpoints, eps)

}) It("should function for client IP based session affinity: udp", func() { <del> startTime := time.Now() </del> config := framework.NewNetworkingTestConfig(f) <del> By(fmt.Sprintf("dialing(udp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, framework.ClusterHttpPort)) </del> <ins> By(fmt.Sprintf("dialing(udp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, framework.ClusterUdpPort)) </ins> updateSessionAffinity := func(svc *v1.Service) { svc.Spec.SessionAffinity = v1.ServiceAffinityClientIP } <del> framework.UpdateService(f.ClientSet, config.NodePortService.Namespace, config.NodePortService.Name, updateSessionAffinity) firstEndpoints, err := config.GetEndpointsFromTestContainer("udp", config.ClusterIP, framework.ClusterUdpPort, config.MaxTries, 0) </del> <ins> _, err := framework.UpdateService(f.ClientSet, config.NodePortService.Namespace, config.NodePortService.Name, updateSessionAffinity) if err != nil { framework.Failf("Failed to update service session affinity, error: %v", err) } // Fetch first endpoints when visiting service firstEndpoints, err := config.GetEndpointsFromTestContainer("udp", config.ClusterIP, framework.ClusterUdpPort, config.MaxTries) </ins> if err != nil { framework.Failf("Unable to get endpoints from test containers: %v", err) } <ins> // Check if first endpoints are equal to endpoints which are fetched later </ins> for i := 0; i < framework.SessionAffinityChecks; i++ { <del> eps, err := config.GetEndpointsFromTestContainer("http", config.ClusterIP, framework.ClusterUdpPort, config.MaxTries, 0) </del> <ins> eps, err := config.GetEndpointsFromTestContainer("udp", config.ClusterIP, framework.ClusterUdpPort, config.MaxTries) </ins> if err != nil { framework.Failf("Unable to get endpoints from test containers: %v", err) }

framework.Failf("Expect endpoints: %v, got: %v", firstEndpoints, eps) } } <del> framework.Failf("test session affinity, cost time: %v", time.Now().Sub(startTime)) </del> }) }) })