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
1df76bc6
Commit
1df76bc6
authored
Jan 09, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add update count statistics in density test
parent
13f3e137
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletion
+33
-1
density.go
test/e2e/density.go
+33
-1
No files found.
test/e2e/density.go
View file @
1df76bc6
...
@@ -250,6 +250,30 @@ var _ = Describe("Density [Skipped]", func() {
...
@@ -250,6 +250,30 @@ var _ = Describe("Density [Skipped]", func() {
stop
:=
make
(
chan
struct
{})
stop
:=
make
(
chan
struct
{})
go
controller
.
Run
(
stop
)
go
controller
.
Run
(
stop
)
// Create a listener for api updates
updateCount
:=
0
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"name"
:
RCName
}))
_
,
updateController
:=
controllerframework
.
NewInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
api
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
.
LabelSelector
=
label
return
c
.
Pods
(
ns
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
options
.
LabelSelector
=
label
return
c
.
Pods
(
ns
)
.
Watch
(
options
)
},
},
&
api
.
Pod
{},
0
,
controllerframework
.
ResourceEventHandlerFuncs
{
UpdateFunc
:
func
(
_
,
_
interface
{})
{
updateCount
++
},
},
)
go
updateController
.
Run
(
stop
)
// Start the replication controller.
// Start the replication controller.
startTime
:=
time
.
Now
()
startTime
:=
time
.
Now
()
expectNoError
(
RunRC
(
config
))
expectNoError
(
RunRC
(
config
))
...
@@ -259,10 +283,14 @@ var _ = Describe("Density [Skipped]", func() {
...
@@ -259,10 +283,14 @@ var _ = Describe("Density [Skipped]", func() {
By
(
"Waiting for all events to be recorded"
)
By
(
"Waiting for all events to be recorded"
)
last
:=
-
1
last
:=
-
1
current
:=
len
(
events
)
current
:=
len
(
events
)
lastCount
:=
-
1
currentCount
:=
updateCount
timeout
:=
10
*
time
.
Minute
timeout
:=
10
*
time
.
Minute
for
start
:=
time
.
Now
();
last
<
current
&&
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
(
last
<
current
||
lastCount
<
currentCount
)
&&
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
10
*
time
.
Second
)
{
last
=
current
last
=
current
current
=
len
(
events
)
current
=
len
(
events
)
lastCount
=
currentCount
currentCount
=
updateCount
}
}
close
(
stop
)
close
(
stop
)
...
@@ -270,6 +298,10 @@ var _ = Describe("Density [Skipped]", func() {
...
@@ -270,6 +298,10 @@ var _ = Describe("Density [Skipped]", func() {
Logf
(
"Warning: Not all events were recorded after waiting %.2f minutes"
,
timeout
.
Minutes
())
Logf
(
"Warning: Not all events were recorded after waiting %.2f minutes"
,
timeout
.
Minutes
())
}
}
Logf
(
"Found %d events"
,
current
)
Logf
(
"Found %d events"
,
current
)
if
updateCount
!=
currentCount
{
Logf
(
"Warning: Not all updates were recorded after waiting %.2f minutes"
,
timeout
.
Minutes
())
}
Logf
(
"Found %d updates"
,
updateCount
)
// Tune the threshold for allowed failures.
// Tune the threshold for allowed failures.
badEvents
:=
BadEvents
(
events
)
badEvents
:=
BadEvents
(
events
)
...
...
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