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
1226c579
Commit
1226c579
authored
Feb 10, 2017
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print running containers in infra container oom score test.
parent
b88b31cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
40 deletions
+51
-40
container_manager_test.go
test/e2e_node/container_manager_test.go
+51
-40
No files found.
test/e2e_node/container_manager_test.go
View file @
1226c579
...
@@ -92,50 +92,61 @@ var _ = framework.KubeDescribe("Kubelet Container Manager [Serial]", func() {
...
@@ -92,50 +92,61 @@ var _ = framework.KubeDescribe("Kubelet Container Manager [Serial]", func() {
return
validateOOMScoreAdjSetting
(
kubeletPids
[
0
],
-
999
)
return
validateOOMScoreAdjSetting
(
kubeletPids
[
0
],
-
999
)
},
5
*
time
.
Minute
,
30
*
time
.
Second
)
.
Should
(
BeNil
())
},
5
*
time
.
Minute
,
30
*
time
.
Second
)
.
Should
(
BeNil
())
})
})
It
(
"pod infra containers oom-score-adj should be -998 and best effort container's should be 1000"
,
func
()
{
Context
(
""
,
func
()
{
var
err
error
It
(
"pod infra containers oom-score-adj should be -998 and best effort container's should be 1000"
,
func
()
{
podClient
:=
f
.
PodClient
()
var
err
error
podName
:=
"besteffort"
+
string
(
uuid
.
NewUUID
())
podClient
:=
f
.
PodClient
()
podClient
.
Create
(
&
v1
.
Pod
{
podName
:=
"besteffort"
+
string
(
uuid
.
NewUUID
())
ObjectMeta
:
metav1
.
ObjectMeta
{
podClient
.
Create
(
&
v1
.
Pod
{
Name
:
podName
,
ObjectMeta
:
metav1
.
ObjectMeta
{
},
Name
:
podName
,
Spec
:
v1
.
PodSpec
{
},
Containers
:
[]
v1
.
Container
{
Spec
:
v1
.
PodSpec
{
{
Containers
:
[]
v1
.
Container
{
Image
:
"gcr.io/google_containers/serve_hostname:v1.4"
,
{
Name
:
podName
,
Image
:
"gcr.io/google_containers/serve_hostname:v1.4"
,
Name
:
podName
,
},
},
},
},
},
},
})
})
var
pausePids
[]
int
var
pausePids
[]
int
By
(
"checking infra container's oom-score-adj"
)
By
(
"checking infra container's oom-score-adj"
)
Eventually
(
func
()
error
{
Eventually
(
func
()
error
{
pausePids
,
err
=
getPidsForProcess
(
"pause"
,
""
)
pausePids
,
err
=
getPidsForProcess
(
"pause"
,
""
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get list of pause pids: %v"
,
err
)
return
fmt
.
Errorf
(
"failed to get list of pause pids: %v"
,
err
)
}
for
_
,
pid
:=
range
pausePids
{
if
err
:=
validateOOMScoreAdjSetting
(
pid
,
-
998
);
err
!=
nil
{
return
err
}
}
for
_
,
pid
:=
range
pausePids
{
if
err
:=
validateOOMScoreAdjSetting
(
pid
,
-
998
);
err
!=
nil
{
return
err
}
}
return
nil
},
2
*
time
.
Minute
,
time
.
Second
*
4
)
.
Should
(
BeNil
())
var
shPids
[]
int
By
(
"checking besteffort container's oom-score-adj"
)
Eventually
(
func
()
error
{
shPids
,
err
=
getPidsForProcess
(
"serve_hostname"
,
""
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get list of serve hostname process pids: %v"
,
err
)
}
if
len
(
shPids
)
!=
1
{
return
fmt
.
Errorf
(
"expected only one serve_hostname process; found %d"
,
len
(
shPids
))
}
return
validateOOMScoreAdjSetting
(
shPids
[
0
],
1000
)
},
2
*
time
.
Minute
,
time
.
Second
*
4
)
.
Should
(
BeNil
())
})
// Log the running containers here to help debugging. Use `docker ps`
// directly for now because the test is already docker specific.
AfterEach
(
func
()
{
if
CurrentGinkgoTestDescription
()
.
Failed
{
By
(
"Dump all running docker containers"
)
output
,
err
:=
exec
.
Command
(
"docker"
,
"ps"
)
.
CombinedOutput
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
framework
.
Logf
(
"Running docker containers:
\n
%s"
,
string
(
output
))
}
}
return
nil
})
},
2
*
time
.
Minute
,
time
.
Second
*
4
)
.
Should
(
BeNil
())
var
shPids
[]
int
By
(
"checking besteffort container's oom-score-adj"
)
Eventually
(
func
()
error
{
shPids
,
err
=
getPidsForProcess
(
"serve_hostname"
,
""
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get list of serve hostname process pids: %v"
,
err
)
}
if
len
(
shPids
)
!=
1
{
return
fmt
.
Errorf
(
"expected only one serve_hostname process; found %d"
,
len
(
shPids
))
}
return
validateOOMScoreAdjSetting
(
shPids
[
0
],
1000
)
},
2
*
time
.
Minute
,
time
.
Second
*
4
)
.
Should
(
BeNil
())
})
})
It
(
"guaranteed container's oom-score-adj should be -998"
,
func
()
{
It
(
"guaranteed container's oom-score-adj should be -998"
,
func
()
{
podClient
:=
f
.
PodClient
()
podClient
:=
f
.
PodClient
()
...
...
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