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
5ef69397
Commit
5ef69397
authored
Mar 26, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5992 from wojtek-t/extend_density_test
Improve density test to log unscheduled pods
parents
1e496696
13feb772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
density.go
test/e2e/density.go
+22
-14
No files found.
test/e2e/density.go
View file @
5ef69397
...
@@ -27,6 +27,7 @@ import (
...
@@ -27,6 +27,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
"github.com/golang/glog"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
)
)
...
@@ -105,7 +106,7 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
...
@@ -105,7 +106,7 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
current
=
len
(
pods
.
Items
)
current
=
len
(
pods
.
Items
)
failCount
:=
5
failCount
:=
5
for
same
<
failCount
&&
current
<
replicas
{
for
same
<
failCount
&&
current
<
replicas
{
Log
f
(
"Controller %s: Found %d pods out of %d"
,
name
,
current
,
replicas
)
glog
.
Info
f
(
"Controller %s: Found %d pods out of %d"
,
name
,
current
,
replicas
)
if
last
<
current
{
if
last
<
current
{
same
=
0
same
=
0
}
else
if
last
==
current
{
}
else
if
last
==
current
{
...
@@ -115,7 +116,7 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
...
@@ -115,7 +116,7 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
}
}
if
same
>=
failCount
{
if
same
>=
failCount
{
Log
f
(
"No pods submitted for the last %d checks"
,
failCount
)
glog
.
Info
f
(
"No pods submitted for the last %d checks"
,
failCount
)
}
}
last
=
current
last
=
current
...
@@ -125,32 +126,39 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
...
@@ -125,32 +126,39 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
current
=
len
(
pods
.
Items
)
current
=
len
(
pods
.
Items
)
}
}
Expect
(
current
)
.
To
(
Equal
(
replicas
))
Expect
(
current
)
.
To
(
Equal
(
replicas
))
Log
f
(
"Controller %s: Found %d pods out of %d"
,
name
,
current
,
replicas
)
glog
.
Info
f
(
"Controller %s: Found %d pods out of %d"
,
name
,
current
,
replicas
)
By
(
"Waiting for each pod to be running"
)
By
(
"Waiting for each pod to be running"
)
same
=
0
same
=
0
last
=
0
last
=
0
failCount
=
6
failCount
=
10
unknown
:=
0
pending
:=
0
current
=
0
current
=
0
for
same
<
failCount
&&
current
<
replicas
{
for
same
<
failCount
&&
current
<
replicas
{
current
=
0
current
=
0
pending
=
0
waiting
:=
0
unknown
=
0
pending
:=
0
unknown
:=
0
time
.
Sleep
(
10
*
time
.
Second
)
time
.
Sleep
(
10
*
time
.
Second
)
for
_
,
pod
:=
range
pods
.
Items
{
p
,
err
:=
c
.
Pods
(
ns
)
.
Get
(
pod
.
Name
)
currentPods
,
listErr
:=
c
.
Pods
(
ns
)
.
List
(
label
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
listErr
)
.
NotTo
(
HaveOccurred
())
if
len
(
currentPods
.
Items
)
!=
len
(
pods
.
Items
)
{
Failf
(
"Number of reported pods changed: %d vs %d"
,
len
(
currentPods
.
Items
),
len
(
pods
.
Items
))
}
for
_
,
p
:=
range
currentPods
.
Items
{
if
p
.
Status
.
Phase
==
api
.
PodRunning
{
if
p
.
Status
.
Phase
==
api
.
PodRunning
{
current
++
current
++
}
else
if
p
.
Status
.
Phase
==
api
.
PodPending
{
}
else
if
p
.
Status
.
Phase
==
api
.
PodPending
{
pending
++
if
p
.
Status
.
Host
==
""
{
waiting
++
}
else
{
pending
++
}
}
else
if
p
.
Status
.
Phase
==
api
.
PodUnknown
{
}
else
if
p
.
Status
.
Phase
==
api
.
PodUnknown
{
unknown
++
unknown
++
}
}
}
}
Logf
(
"Pod States: %d running, %d pending, %d unknown "
,
current
,
pend
ing
,
unknown
)
glog
.
Infof
(
"Pod States: %d running, %d pending, %d waiting, %d unknown "
,
current
,
pending
,
wait
ing
,
unknown
)
if
last
<
current
{
if
last
<
current
{
same
=
0
same
=
0
}
else
if
last
==
current
{
}
else
if
last
==
current
{
...
@@ -159,7 +167,7 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
...
@@ -159,7 +167,7 @@ func RunRC(c *client.Client, name string, ns, image string, replicas int) {
Failf
(
"Number of running pods dropped from %d to %d"
,
last
,
current
)
Failf
(
"Number of running pods dropped from %d to %d"
,
last
,
current
)
}
}
if
same
>=
failCount
{
if
same
>=
failCount
{
Log
f
(
"No pods started for the last %d checks"
,
failCount
)
glog
.
Info
f
(
"No pods started for the last %d checks"
,
failCount
)
}
}
last
=
current
last
=
current
}
}
...
...
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