From a4bbf925770c41ee8db4f3be24ef884ffd5ad2b4 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Mon, 13 Dec 2021 10:33:35 +0100 Subject: [PATCH] cap nunmber of tries on e2e nodePort stop service test The tests were asserting that after a NodePort Service was removed, no new traffic was still reaching the endpoints. However, the number of tries was so large that another test running in parallel could create a working Service on that NodePort, making the test fails. Use only 10 tries to confirm that the Service stopped working. --- test/e2e/network/networking.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index b5c0728a5ae..2d1f960c1bb 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -369,9 +369,12 @@ var _ = common.SIGDescribe("Networking", func() { config.DeleteNodePortService() ginkgo.By(fmt.Sprintf("dialing(http) %v (node) --> %v:%v (nodeIP) and getting ZERO host endpoints", config.NodeIP, config.NodeIP, config.NodeHTTPPort)) - err = config.DialFromNode("http", config.NodeIP, config.NodeHTTPPort, config.MaxTries, config.MaxTries, sets.NewString()) + // #106770 MaxTries can be very large on large clusters, with the risk that a new NodePort is created by another test and start to answer traffic. + // Since we only want to assert that traffic is not being forwarded anymore and the retry timeout is 2 seconds, consider the test is correct + // if the service doesn't answer after 10 tries. + err = config.DialFromNode("http", config.NodeIP, config.NodeHTTPPort, 10, 10, sets.NewString()) if err != nil { - framework.Failf("Error dialing http from node: %v", err) + framework.Failf("Failure validating that node port service STOPPED removed properly: %v", err) } }) @@ -398,7 +401,10 @@ var _ = common.SIGDescribe("Networking", func() { config.DeleteNodePortService() ginkgo.By(fmt.Sprintf("dialing(udp) %v (node) --> %v:%v (nodeIP) and getting ZERO host endpoints", config.NodeIP, config.NodeIP, config.NodeUDPPort)) - err = config.DialFromNode("udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, config.MaxTries, sets.NewString()) + // #106770 MaxTries can be very large on large clusters, with the risk that a new NodePort is created by another test and start to answer traffic. + // Since we only want to assert that traffic is not being forwarded anymore and the retry timeout is 2 seconds, consider the test is correct + // if the service doesn't answer after 10 tries. + err = config.DialFromNode("udp", config.NodeIP, config.NodeUDPPort, 10, 10, sets.NewString()) if err != nil { framework.Failf("Failure validating that node port service STOPPED removed properly: %v", err) }