mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-07 19:29:45 +00:00
Address top flaky tests (#12163)
* ExternalIP E2E test: Improve clientIP checking * E2E: Better top node error logs * Skew test: increase deployment timeout Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
committed by
Brad Davidson
parent
6b330558e4
commit
0162910d9e
@@ -101,7 +101,7 @@ var _ = Describe("Skew Tests", Ordered, func() {
|
||||
Expect(config.ProvisionServers(3)).To(Succeed())
|
||||
Eventually(func() error {
|
||||
return tests.CheckDeployments([]string{"coredns", "local-path-provisioner", "metrics-server", "traefik"}, config.KubeconfigFile)
|
||||
}, "180s", "5s").Should(Succeed())
|
||||
}, "240s", "10s").Should(Succeed())
|
||||
Eventually(func(g Gomega) {
|
||||
g.Expect(tests.ParseNodes(config.KubeconfigFile)).To(HaveLen(3))
|
||||
g.Expect(tests.NodesReady(config.KubeconfigFile, config.GetNodeNames())).To(Succeed())
|
||||
|
||||
@@ -114,18 +114,21 @@ var _ = Describe("Verify External-IP config", Ordered, func() {
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
// Wait for the pod_client to have an IP
|
||||
Eventually(func() string {
|
||||
ips, _ := getClientIPs(tc.KubeconfigFile)
|
||||
return ips[0].IPv4
|
||||
}, "40s", "5s").Should(ContainSubstring("10.42"), "failed getClientIPs")
|
||||
var clientIPs []e2e.ObjIP
|
||||
Eventually(func(g Gomega) {
|
||||
clientIPs, err = getClientIPs(tc.KubeconfigFile)
|
||||
g.Expect(err).NotTo(HaveOccurred())
|
||||
g.Expect(len(clientIPs)).Should(BeNumerically(">", 0), "client pod IPs")
|
||||
for _, ip := range clientIPs {
|
||||
g.Expect(ip.IPv4).Should(ContainSubstring("10.42."), "client pod IP: "+ip.IPv4)
|
||||
}
|
||||
}, "40s", "5s").Should(Succeed(), "failed getClientIPs")
|
||||
|
||||
clientIPs, err := getClientIPs(tc.KubeconfigFile)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
for _, ip := range clientIPs {
|
||||
cmd := "kubectl exec svc/client-curl -- curl -m 5 -s -f http://" + ip.IPv4 + "/name.html"
|
||||
Eventually(func() (string, error) {
|
||||
return e2e.RunCommand(cmd)
|
||||
}, "20s", "3s").Should(ContainSubstring("client-deployment"), "failed cmd: "+cmd)
|
||||
}, "30s", "10s").Should(ContainSubstring("client-deployment"), "failed cmd: "+cmd)
|
||||
}
|
||||
})
|
||||
It("Verifies loadBalancer service's IP is the node-external-ip", func() {
|
||||
|
||||
@@ -115,16 +115,18 @@ var _ = Describe("Various Startup Configurations", Ordered, func() {
|
||||
|
||||
It("Returns pod metrics", func() {
|
||||
cmd := "kubectl top pod -A"
|
||||
var res string
|
||||
var err error
|
||||
Eventually(func() error {
|
||||
_, err := e2e.RunCommand(cmd)
|
||||
res, err = e2e.RunCommand(cmd)
|
||||
return err
|
||||
}, "600s", "5s").Should(Succeed())
|
||||
}, "600s", "5s").Should(Succeed(), "failed to get pod metrics: %s", res)
|
||||
})
|
||||
|
||||
It("Returns node metrics", func() {
|
||||
cmd := "kubectl top node"
|
||||
_, err := e2e.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
res, err := e2e.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred(), "failed to get node metrics: %s", res)
|
||||
})
|
||||
|
||||
It("Runs an interactive command a pod", func() {
|
||||
|
||||
@@ -139,8 +139,8 @@ var _ = Describe("Various Startup Configurations", Ordered, func() {
|
||||
|
||||
It("Returns node metrics", func() {
|
||||
cmd := "kubectl top node"
|
||||
_, err := e2e.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
res, err := e2e.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred(), "failed to get node metrics: %s", res)
|
||||
})
|
||||
|
||||
It("Runs an interactive command a pod", func() {
|
||||
@@ -308,8 +308,8 @@ var _ = Describe("Various Startup Configurations", Ordered, func() {
|
||||
|
||||
It("Returns node metrics", func() {
|
||||
cmd := "kubectl top node"
|
||||
_, err := e2e.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
res, err := e2e.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred(), "failed to get node metrics: %s", res)
|
||||
})
|
||||
|
||||
It("Runs an interactive command a pod", func() {
|
||||
|
||||
Reference in New Issue
Block a user