@@ -17,6 +17,7 @@ limitations under the License.
17
17
package network
18
18
19
19
import (
20
+ "bufio"
20
21
"context"
21
22
"fmt"
22
23
"strconv"
@@ -327,6 +328,37 @@ var _ = common.SIGDescribe("Networking", func() {
327
328
328
329
ginkgo .It ("should update endpoints: http" , func (ctx context.Context ) {
329
330
config := e2enetwork .NewNetworkingTestConfig (ctx , f )
331
+
332
+ // start of intermittent code snippet to understand the reason for flaky behaviour
333
+ // TODO @aroradaman @aojea remove this once issue #123760 is resolved
334
+ // streaming logs for netserver-0 which will be deleted during the test
335
+ // (ref: https://github.com/kubernetes/kubernetes/issues/123760)
336
+ pod0name := config .EndpointPods [0 ].Name
337
+ go func () {
338
+ defer ginkgo .GinkgoRecover ()
339
+ readCloser , err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).GetLogs (pod0name , & v1.PodLogOptions {
340
+ Follow : true ,
341
+ }).Stream (ctx )
342
+
343
+ // silently ignoring error, we don't want to disturb the original test
344
+ if err != nil {
345
+ return
346
+ }
347
+ defer func () {
348
+ _ = readCloser .Close ()
349
+ }()
350
+
351
+ scanner := bufio .NewScanner (readCloser )
352
+ var lines []string
353
+ for scanner .Scan () {
354
+ lines = append (lines , "\t \t " + scanner .Text ())
355
+ }
356
+ framework .Logf ("================ start of pod log for %s ================" , pod0name )
357
+ framework .Logf ("\n %s" , strings .Join (lines , "\n " ))
358
+ framework .Logf ("================ end of pod log for %s ================" , pod0name )
359
+ }()
360
+ // end of intermittent code snippet
361
+
330
362
ginkgo .By (fmt .Sprintf ("dialing(http) %v --> %v:%v (config.clusterIP)" , config .TestContainerPod .Name , config .ClusterIP , e2enetwork .ClusterHTTPPort ))
331
363
err := config .DialFromTestContainer (ctx , "http" , config .ClusterIP , e2enetwork .ClusterHTTPPort , config .MaxTries , 0 , config .EndpointHostnames ())
332
364
if err != nil {
0 commit comments