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
b8a83b98
Commit
b8a83b98
authored
Oct 27, 2016
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove outdated parts of density test
parent
1fd5289e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
113 deletions
+0
-113
density.go
test/e2e/density.go
+0
-86
util.go
test/e2e/framework/util.go
+0
-27
No files found.
test/e2e/density.go
View file @
b8a83b98
...
...
@@ -185,59 +185,6 @@ func logPodStartupStatus(c internalclientset.Interface, expectedPods int, ns str
// all pods to start
func
runDensityTest
(
dtc
DensityTestConfig
)
time
.
Duration
{
defer
GinkgoRecover
()
// Create a listener for events.
// eLock is a lock protects the events
var
eLock
sync
.
Mutex
events
:=
make
([](
*
api
.
Event
),
0
)
_
,
controller
:=
cache
.
NewInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
api
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
dtc
.
ClientSet
.
Core
()
.
Events
(
dtc
.
Namespace
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
dtc
.
ClientSet
.
Core
()
.
Events
(
dtc
.
Namespace
)
.
Watch
(
options
)
},
},
&
api
.
Event
{},
0
,
cache
.
ResourceEventHandlerFuncs
{
AddFunc
:
func
(
obj
interface
{})
{
eLock
.
Lock
()
defer
eLock
.
Unlock
()
events
=
append
(
events
,
obj
.
(
*
api
.
Event
))
},
},
)
stop
:=
make
(
chan
struct
{})
go
controller
.
Run
(
stop
)
// Create a listener for api updates
// uLock is a lock protects the updateCount
var
uLock
sync
.
Mutex
updateCount
:=
0
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"type"
:
"densityPod"
}))
_
,
updateController
:=
cache
.
NewInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
api
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
options
.
LabelSelector
=
label
return
dtc
.
ClientSet
.
Core
()
.
Pods
(
dtc
.
Namespace
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
options
.
LabelSelector
=
label
return
dtc
.
ClientSet
.
Core
()
.
Pods
(
dtc
.
Namespace
)
.
Watch
(
options
)
},
},
&
api
.
Pod
{},
0
,
cache
.
ResourceEventHandlerFuncs
{
UpdateFunc
:
func
(
_
,
_
interface
{})
{
uLock
.
Lock
()
defer
uLock
.
Unlock
()
updateCount
++
},
},
)
go
updateController
.
Run
(
stop
)
// Start all replication controllers.
startTime
:=
time
.
Now
()
...
...
@@ -259,39 +206,6 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
framework
.
Logf
(
"E2E startup time for %d pods: %v"
,
dtc
.
PodCount
,
startupTime
)
framework
.
Logf
(
"Throughput (pods/s) during cluster saturation phase: %v"
,
float32
(
dtc
.
PodCount
)
/
float32
(
startupTime
/
time
.
Second
))
By
(
"Waiting for all events to be recorded"
)
last
:=
-
1
current
:=
len
(
events
)
lastCount
:=
-
1
currentCount
:=
updateCount
for
start
:=
time
.
Now
();
(
last
<
current
||
lastCount
<
currentCount
)
&&
time
.
Since
(
start
)
<
dtc
.
Timeout
;
time
.
Sleep
(
10
*
time
.
Second
)
{
func
()
{
eLock
.
Lock
()
defer
eLock
.
Unlock
()
last
=
current
current
=
len
(
events
)
}()
func
()
{
uLock
.
Lock
()
defer
uLock
.
Unlock
()
lastCount
=
currentCount
currentCount
=
updateCount
}()
}
close
(
stop
)
if
current
!=
last
{
framework
.
Logf
(
"Warning: Not all events were recorded after waiting %.2f minutes"
,
dtc
.
Timeout
.
Minutes
())
}
framework
.
Logf
(
"Found %d events"
,
current
)
if
currentCount
!=
lastCount
{
framework
.
Logf
(
"Warning: Not all updates were recorded after waiting %.2f minutes"
,
dtc
.
Timeout
.
Minutes
())
}
framework
.
Logf
(
"Found %d updates"
,
currentCount
)
// Tune the threshold for allowed failures.
badEvents
:=
framework
.
BadEvents
(
events
)
Expect
(
badEvents
)
.
NotTo
(
BeNumerically
(
">"
,
int
(
math
.
Floor
(
0.01
*
float64
(
dtc
.
PodCount
)))))
// Print some data about Pod to Node allocation
By
(
"Printing Pod to Node allocation data"
)
podList
,
err
:=
dtc
.
ClientSet
.
Core
()
.
Pods
(
api
.
NamespaceAll
)
.
List
(
api
.
ListOptions
{})
...
...
test/e2e/framework/util.go
View file @
b8a83b98
...
...
@@ -3216,33 +3216,6 @@ func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string,
return
deployment
,
err
}
// Prints the histogram of the events and returns the number of bad events.
func
BadEvents
(
events
[]
*
api
.
Event
)
int
{
type
histogramKey
struct
{
reason
string
source
string
}
histogram
:=
make
(
map
[
histogramKey
]
int
)
for
_
,
e
:=
range
events
{
histogram
[
histogramKey
{
reason
:
e
.
Reason
,
source
:
e
.
Source
.
Component
}]
++
}
for
key
,
number
:=
range
histogram
{
Logf
(
"- reason: %s, source: %s -> %d"
,
key
.
reason
,
key
.
source
,
number
)
}
badPatterns
:=
[]
string
{
"kill"
,
"fail"
}
badEvents
:=
0
for
key
,
number
:=
range
histogram
{
for
_
,
s
:=
range
badPatterns
{
if
strings
.
Contains
(
key
.
reason
,
s
)
{
Logf
(
"WARNING %d events from %s with reason: %s"
,
number
,
key
.
source
,
key
.
reason
)
badEvents
+=
number
break
}
}
}
return
badEvents
}
// NodeAddresses returns the first address of the given type of each node.
func
NodeAddresses
(
nodelist
*
api
.
NodeList
,
addrType
api
.
NodeAddressType
)
[]
string
{
hosts
:=
[]
string
{}
...
...
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