Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f579f8ed
Commit
f579f8ed
authored
Oct 01, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14790 from yujuhong/restart_count
Auto commit by PR queue bot
parents
a463b345
5177e82d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
e2e.sh
hack/jenkins/e2e.sh
+1
-1
pods.go
test/e2e/pods.go
+12
-8
No files found.
hack/jenkins/e2e.sh
View file @
f579f8ed
...
@@ -120,7 +120,6 @@ GCE_FLAKY_TESTS=(
...
@@ -120,7 +120,6 @@ GCE_FLAKY_TESTS=(
"DaemonRestart"
"DaemonRestart"
"Daemon
\s
set
\s
should
\s
launch
\s
a
\s
daemon
\s
pod
\s
on
\s
every
\s
node
\s
of
\s
the
\s
cluster"
"Daemon
\s
set
\s
should
\s
launch
\s
a
\s
daemon
\s
pod
\s
on
\s
every
\s
node
\s
of
\s
the
\s
cluster"
"Resource
\s
usage
\s
of
\s
system
\s
containers"
"Resource
\s
usage
\s
of
\s
system
\s
containers"
"monotonically
\s
increasing
\s
restart
\s
count"
"should
\s
be
\s
able
\s
to
\s
change
\s
the
\s
type
\s
and
\s
nodeport
\s
settings
\s
of
\s
a
\s
service"
# file: service.go, issue: #13032
"should
\s
be
\s
able
\s
to
\s
change
\s
the
\s
type
\s
and
\s
nodeport
\s
settings
\s
of
\s
a
\s
service"
# file: service.go, issue: #13032
"allows
\s
scheduling
\s
of
\s
pods
\s
on
\s
a
\s
minion
\s
after
\s
it
\s
rejoins
\s
the
\s
cluster"
# file: resize_nodes.go, issue: #13258
"allows
\s
scheduling
\s
of
\s
pods
\s
on
\s
a
\s
minion
\s
after
\s
it
\s
rejoins
\s
the
\s
cluster"
# file: resize_nodes.go, issue: #13258
"should
\s
release
\s
the
\s
load
\s
balancer
\s
when
\s
Type
\s
goes
\s
from
\s
LoadBalancer"
# timeouts in 20 minutes in last builds. #14424
"should
\s
release
\s
the
\s
load
\s
balancer
\s
when
\s
Type
\s
goes
\s
from
\s
LoadBalancer"
# timeouts in 20 minutes in last builds. #14424
...
@@ -138,6 +137,7 @@ GCE_SLOW_TESTS=(
...
@@ -138,6 +137,7 @@ GCE_SLOW_TESTS=(
"SchedulerPredicates
\s
validates
\s
MaxPods
\s
limit "
# 8 min, file: scheduler_predicates.go, PR: #13315
"SchedulerPredicates
\s
validates
\s
MaxPods
\s
limit "
# 8 min, file: scheduler_predicates.go, PR: #13315
"Nodes
\s
Resize"
# 3 min 30 sec, file: resize_nodes.go, issue: #13323
"Nodes
\s
Resize"
# 3 min 30 sec, file: resize_nodes.go, issue: #13323
"resource
\s
usage
\s
tracking"
# 1 hour, file: kubelet_perf.go, slow by design
"resource
\s
usage
\s
tracking"
# 1 hour, file: kubelet_perf.go, slow by design
"monotonically
\s
increasing
\s
restart
\s
count"
# 1.5 to 5 min, file: pods.go, slow by design
)
)
# Tests which are not able to be run in parallel.
# Tests which are not able to be run in parallel.
...
...
test/e2e/pods.go
View file @
f579f8ed
...
@@ -35,7 +35,11 @@ import (
...
@@ -35,7 +35,11 @@ import (
.
"github.com/onsi/gomega"
.
"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
))
By
(
fmt
.
Sprintf
(
"Creating pod %s in namespace %s"
,
podDescr
.
Name
,
ns
))
_
,
err
:=
c
.
Pods
(
ns
)
.
Create
(
podDescr
)
_
,
err
:=
c
.
Pods
(
ns
)
.
Create
(
podDescr
)
expectNoError
(
err
,
fmt
.
Sprintf
(
"creating pod %s"
,
podDescr
.
Name
))
expectNoError
(
err
,
fmt
.
Sprintf
(
"creating pod %s"
,
podDescr
.
Name
))
...
@@ -61,7 +65,7 @@ func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectNumRe
...
@@ -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
))
By
(
fmt
.
Sprintf
(
"Initial restart count of pod %s is %d"
,
podDescr
.
Name
,
initialRestartCount
))
// Wait for the restart state to be as desired.
// Wait for the restart state to be as desired.
deadline
:=
time
.
Now
()
.
Add
(
2
*
time
.
Minute
)
deadline
:=
time
.
Now
()
.
Add
(
timeout
)
lastRestartCount
:=
initialRestartCount
lastRestartCount
:=
initialRestartCount
observedRestarts
:=
0
observedRestarts
:=
0
for
start
:=
time
.
Now
();
time
.
Now
()
.
Before
(
deadline
);
time
.
Sleep
(
2
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Now
()
.
Before
(
deadline
);
time
.
Sleep
(
2
*
time
.
Second
)
{
...
@@ -482,7 +486,7 @@ var _ = Describe("Pods", func() {
...
@@ -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
()
{
It
(
"should *not* be restarted with a docker exec
\"
cat /tmp/health
\"
liveness probe"
,
func
()
{
...
@@ -508,7 +512,7 @@ var _ = Describe("Pods", func() {
...
@@ -508,7 +512,7 @@ var _ = Describe("Pods", func() {
},
},
},
},
},
},
},
0
)
},
0
,
defaultObservationTimeout
)
})
})
It
(
"should be restarted with a /healthz http liveness probe"
,
func
()
{
It
(
"should be restarted with a /healthz http liveness probe"
,
func
()
{
...
@@ -535,10 +539,10 @@ var _ = Describe("Pods", func() {
...
@@ -535,10 +539,10 @@ var _ = Describe("Pods", func() {
},
},
},
},
},
},
},
1
)
},
1
,
defaultObservationTimeout
)
})
})
P
It
(
"should have monotonically increasing restart count"
,
func
()
{
It
(
"should have monotonically increasing restart count"
,
func
()
{
runLivenessTest
(
framework
.
Client
,
framework
.
Namespace
.
Name
,
&
api
.
Pod
{
runLivenessTest
(
framework
.
Client
,
framework
.
Namespace
.
Name
,
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"liveness-http"
,
Name
:
"liveness-http"
,
...
@@ -562,7 +566,7 @@ var _ = Describe("Pods", func() {
...
@@ -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
()
{
It
(
"should *not* be restarted with a /healthz http liveness probe"
,
func
()
{
...
@@ -595,7 +599,7 @@ var _ = Describe("Pods", func() {
...
@@ -595,7 +599,7 @@ var _ = Describe("Pods", func() {
},
},
},
},
},
},
},
0
)
},
0
,
defaultObservationTimeout
)
})
})
// The following tests for remote command execution and port forwarding are
// The following tests for remote command execution and port forwarding are
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment