mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #14790 from yujuhong/restart_count
Auto commit by PR queue bot
This commit is contained in:
commit
f579f8edc3
@ -120,7 +120,6 @@ GCE_FLAKY_TESTS=(
|
||||
"DaemonRestart"
|
||||
"Daemon\sset\sshould\slaunch\sa\sdaemon\spod\son\severy\snode\sof\sthe\scluster"
|
||||
"Resource\susage\sof\ssystem\scontainers"
|
||||
"monotonically\sincreasing\srestart\scount"
|
||||
"should\sbe\sable\sto\schange\sthe\stype\sand\snodeport\ssettings\sof\sa\sservice" # file: service.go, issue: #13032
|
||||
"allows\sscheduling\sof\spods\son\sa\sminion\safter\sit\srejoins\sthe\scluster" # file: resize_nodes.go, issue: #13258
|
||||
"should\srelease\sthe\sload\sbalancer\swhen\sType\sgoes\sfrom\sLoadBalancer" # timeouts in 20 minutes in last builds. #14424
|
||||
@ -138,6 +137,7 @@ GCE_SLOW_TESTS=(
|
||||
"SchedulerPredicates\svalidates\sMaxPods\slimit " # 8 min, file: scheduler_predicates.go, PR: #13315
|
||||
"Nodes\sResize" # 3 min 30 sec, file: resize_nodes.go, issue: #13323
|
||||
"resource\susage\stracking" # 1 hour, file: kubelet_perf.go, slow by design
|
||||
"monotonically\sincreasing\srestart\scount" # 1.5 to 5 min, file: pods.go, slow by design
|
||||
)
|
||||
|
||||
# Tests which are not able to be run in parallel.
|
||||
|
@ -35,7 +35,11 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectNumRestarts int) {
|
||||
const (
|
||||
defaultObservationTimeout = time.Minute * 2
|
||||
)
|
||||
|
||||
func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectNumRestarts int, timeout time.Duration) {
|
||||
By(fmt.Sprintf("Creating pod %s in namespace %s", podDescr.Name, ns))
|
||||
_, err := c.Pods(ns).Create(podDescr)
|
||||
expectNoError(err, fmt.Sprintf("creating pod %s", podDescr.Name))
|
||||
@ -61,7 +65,7 @@ func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectNumRe
|
||||
By(fmt.Sprintf("Initial restart count of pod %s is %d", podDescr.Name, initialRestartCount))
|
||||
|
||||
// Wait for the restart state to be as desired.
|
||||
deadline := time.Now().Add(2 * time.Minute)
|
||||
deadline := time.Now().Add(timeout)
|
||||
lastRestartCount := initialRestartCount
|
||||
observedRestarts := 0
|
||||
for start := time.Now(); time.Now().Before(deadline); time.Sleep(2 * time.Second) {
|
||||
@ -482,7 +486,7 @@ var _ = Describe("Pods", func() {
|
||||
},
|
||||
},
|
||||
},
|
||||
}, 1)
|
||||
}, 1, defaultObservationTimeout)
|
||||
})
|
||||
|
||||
It("should *not* be restarted with a docker exec \"cat /tmp/health\" liveness probe", func() {
|
||||
@ -508,7 +512,7 @@ var _ = Describe("Pods", func() {
|
||||
},
|
||||
},
|
||||
},
|
||||
}, 0)
|
||||
}, 0, defaultObservationTimeout)
|
||||
})
|
||||
|
||||
It("should be restarted with a /healthz http liveness probe", func() {
|
||||
@ -535,10 +539,10 @@ var _ = Describe("Pods", func() {
|
||||
},
|
||||
},
|
||||
},
|
||||
}, 1)
|
||||
}, 1, defaultObservationTimeout)
|
||||
})
|
||||
|
||||
PIt("should have monotonically increasing restart count", func() {
|
||||
It("should have monotonically increasing restart count", func() {
|
||||
runLivenessTest(framework.Client, framework.Namespace.Name, &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "liveness-http",
|
||||
@ -562,7 +566,7 @@ var _ = Describe("Pods", func() {
|
||||
},
|
||||
},
|
||||
},
|
||||
}, 8)
|
||||
}, 5, time.Minute*5)
|
||||
})
|
||||
|
||||
It("should *not* be restarted with a /healthz http liveness probe", func() {
|
||||
@ -595,7 +599,7 @@ var _ = Describe("Pods", func() {
|
||||
},
|
||||
},
|
||||
},
|
||||
}, 0)
|
||||
}, 0, defaultObservationTimeout)
|
||||
})
|
||||
|
||||
// The following tests for remote command execution and port forwarding are
|
||||
|
Loading…
Reference in New Issue
Block a user