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
b18fd60b
Commit
b18fd60b
authored
Jun 28, 2017
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use multiple clients in the density test
parent
60895578
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
23 deletions
+27
-23
density.go
test/e2e/perf/density.go
+24
-20
load.go
test/e2e/perf/load.go
+3
-3
No files found.
test/e2e/perf/density.go
View file @
b18fd60b
...
@@ -59,11 +59,11 @@ const (
...
@@ -59,11 +59,11 @@ const (
var
MaxContainerFailures
=
0
var
MaxContainerFailures
=
0
type
DensityTestConfig
struct
{
type
DensityTestConfig
struct
{
Configs
[]
testutils
.
RunObjectConfig
Configs
[]
testutils
.
RunObjectConfig
ClientSet
clientset
.
Interface
ClientSet
s
[]
clientset
.
Interface
InternalClientset
internalclientset
.
Interface
InternalClientset
s
[]
internalclientset
.
Interface
PollInterval
time
.
Duration
PollInterval
time
.
Duration
PodCount
int
PodCount
int
// What kind of resource we want to create
// What kind of resource we want to create
kind
schema
.
GroupKind
kind
schema
.
GroupKind
SecretConfigs
[]
*
testutils
.
SecretConfig
SecretConfigs
[]
*
testutils
.
SecretConfig
...
@@ -220,7 +220,7 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
...
@@ -220,7 +220,7 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
}()
}()
}
}
logStopCh
:=
make
(
chan
struct
{})
logStopCh
:=
make
(
chan
struct
{})
go
logPodStartupStatus
(
dtc
.
ClientSet
,
dtc
.
PodCount
,
map
[
string
]
string
{
"type"
:
"densityPod"
},
dtc
.
PollInterval
,
logStopCh
)
go
logPodStartupStatus
(
dtc
.
ClientSet
s
[
0
]
,
dtc
.
PodCount
,
map
[
string
]
string
{
"type"
:
"densityPod"
},
dtc
.
PollInterval
,
logStopCh
)
wg
.
Wait
()
wg
.
Wait
()
startupTime
:=
time
.
Now
()
.
Sub
(
startTime
)
startupTime
:=
time
.
Now
()
.
Sub
(
startTime
)
close
(
logStopCh
)
close
(
logStopCh
)
...
@@ -229,7 +229,7 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
...
@@ -229,7 +229,7 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
// Print some data about Pod to Node allocation
// Print some data about Pod to Node allocation
By
(
"Printing Pod to Node allocation data"
)
By
(
"Printing Pod to Node allocation data"
)
podList
,
err
:=
dtc
.
ClientSet
.
Core
()
.
Pods
(
metav1
.
NamespaceAll
)
.
List
(
metav1
.
ListOptions
{})
podList
,
err
:=
dtc
.
ClientSet
s
[
0
]
.
Core
()
.
Pods
(
metav1
.
NamespaceAll
)
.
List
(
metav1
.
ListOptions
{})
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
pausePodAllocation
:=
make
(
map
[
string
]
int
)
pausePodAllocation
:=
make
(
map
[
string
]
int
)
systemPodAllocation
:=
make
(
map
[
string
][]
string
)
systemPodAllocation
:=
make
(
map
[
string
][]
string
)
...
@@ -254,6 +254,7 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
...
@@ -254,6 +254,7 @@ func runDensityTest(dtc DensityTestConfig) time.Duration {
func
cleanupDensityTest
(
dtc
DensityTestConfig
)
{
func
cleanupDensityTest
(
dtc
DensityTestConfig
)
{
defer
GinkgoRecover
()
defer
GinkgoRecover
()
By
(
"Deleting created Collections"
)
By
(
"Deleting created Collections"
)
numberOfClients
:=
len
(
dtc
.
ClientSets
)
// We explicitly delete all pods to have API calls necessary for deletion accounted in metrics.
// We explicitly delete all pods to have API calls necessary for deletion accounted in metrics.
for
i
:=
range
dtc
.
Configs
{
for
i
:=
range
dtc
.
Configs
{
name
:=
dtc
.
Configs
[
i
]
.
GetName
()
name
:=
dtc
.
Configs
[
i
]
.
GetName
()
...
@@ -261,11 +262,11 @@ func cleanupDensityTest(dtc DensityTestConfig) {
...
@@ -261,11 +262,11 @@ func cleanupDensityTest(dtc DensityTestConfig) {
kind
:=
dtc
.
Configs
[
i
]
.
GetKind
()
kind
:=
dtc
.
Configs
[
i
]
.
GetKind
()
if
framework
.
TestContext
.
GarbageCollectorEnabled
&&
kindSupportsGarbageCollector
(
kind
)
{
if
framework
.
TestContext
.
GarbageCollectorEnabled
&&
kindSupportsGarbageCollector
(
kind
)
{
By
(
fmt
.
Sprintf
(
"Cleaning up only the %v, garbage collector will clean up the pods"
,
kind
))
By
(
fmt
.
Sprintf
(
"Cleaning up only the %v, garbage collector will clean up the pods"
,
kind
))
err
:=
framework
.
DeleteResourceAndWaitForGC
(
dtc
.
ClientSet
,
kind
,
namespace
,
name
)
err
:=
framework
.
DeleteResourceAndWaitForGC
(
dtc
.
ClientSet
s
[
i
%
numberOfClients
]
,
kind
,
namespace
,
name
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
}
else
{
}
else
{
By
(
fmt
.
Sprintf
(
"Cleaning up the %v and pods"
,
kind
))
By
(
fmt
.
Sprintf
(
"Cleaning up the %v and pods"
,
kind
))
err
:=
framework
.
DeleteResourceAndPods
(
dtc
.
ClientSet
,
dtc
.
InternalClientset
,
kind
,
namespace
,
name
)
err
:=
framework
.
DeleteResourceAndPods
(
dtc
.
ClientSet
s
[
i
%
numberOfClients
],
dtc
.
InternalClientsets
[
i
%
numberOfClients
]
,
kind
,
namespace
,
name
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
}
}
}
}
...
@@ -279,8 +280,8 @@ func cleanupDensityTest(dtc DensityTestConfig) {
...
@@ -279,8 +280,8 @@ func cleanupDensityTest(dtc DensityTestConfig) {
}
}
for
i
:=
range
dtc
.
DaemonConfigs
{
for
i
:=
range
dtc
.
DaemonConfigs
{
framework
.
ExpectNoError
(
framework
.
DeleteResourceAndPods
(
framework
.
ExpectNoError
(
framework
.
DeleteResourceAndPods
(
dtc
.
ClientSet
,
dtc
.
ClientSet
s
[
i
%
numberOfClients
]
,
dtc
.
InternalClientset
,
dtc
.
InternalClientset
s
[
i
%
numberOfClients
]
,
extensions
.
Kind
(
"DaemonSet"
),
extensions
.
Kind
(
"DaemonSet"
),
dtc
.
DaemonConfigs
[
i
]
.
Namespace
,
dtc
.
DaemonConfigs
[
i
]
.
Namespace
,
dtc
.
DaemonConfigs
[
i
]
.
Name
,
dtc
.
DaemonConfigs
[
i
]
.
Name
,
...
@@ -535,15 +536,18 @@ var _ = framework.KubeDescribe("Density", func() {
...
@@ -535,15 +536,18 @@ var _ = framework.KubeDescribe("Density", func() {
}
}
}
}
// Single client is running out of http2 connections in delete phase, hence we need more.
clients
,
internalClients
,
err
=
createClients
(
2
)
dConfig
:=
DensityTestConfig
{
dConfig
:=
DensityTestConfig
{
ClientSet
:
f
.
ClientSet
,
ClientSet
s
:
clients
,
InternalClientset
:
f
.
InternalClientset
,
InternalClientset
s
:
internalClients
,
Configs
:
configs
,
Configs
:
configs
,
PodCount
:
totalPods
,
PodCount
:
totalPods
,
PollInterval
:
DensityPollInterval
,
PollInterval
:
DensityPollInterval
,
kind
:
itArg
.
kind
,
kind
:
itArg
.
kind
,
SecretConfigs
:
secretConfigs
,
SecretConfigs
:
secretConfigs
,
ConfigMapConfigs
:
configMapConfigs
,
ConfigMapConfigs
:
configMapConfigs
,
}
}
for
i
:=
0
;
i
<
itArg
.
daemonsPerNode
;
i
++
{
for
i
:=
0
;
i
<
itArg
.
daemonsPerNode
;
i
++
{
...
@@ -804,7 +808,7 @@ var _ = framework.KubeDescribe("Density", func() {
...
@@ -804,7 +808,7 @@ var _ = framework.KubeDescribe("Density", func() {
}
}
}
}
dConfig
:=
DensityTestConfig
{
dConfig
:=
DensityTestConfig
{
ClientSet
:
f
.
ClientSet
,
ClientSet
s
:
[]
clientset
.
Interface
{
f
.
ClientSet
}
,
Configs
:
configs
,
Configs
:
configs
,
PodCount
:
totalPods
,
PodCount
:
totalPods
,
PollInterval
:
DensityPollInterval
,
PollInterval
:
DensityPollInterval
,
...
...
test/e2e/perf/load.go
View file @
b18fd60b
...
@@ -288,9 +288,9 @@ var _ = framework.KubeDescribe("Load capacity", func() {
...
@@ -288,9 +288,9 @@ var _ = framework.KubeDescribe("Load capacity", func() {
}
}
})
})
func
createClients
(
numberOfClients
int
)
([]
*
clientset
.
Clientset
,
[]
*
internalclientset
.
Clientset
,
error
)
{
func
createClients
(
numberOfClients
int
)
([]
clientset
.
Interface
,
[]
internalclientset
.
Interface
,
error
)
{
clients
:=
make
([]
*
clientset
.
Clientset
,
numberOfClients
)
clients
:=
make
([]
clientset
.
Interface
,
numberOfClients
)
internalClients
:=
make
([]
*
internalclientset
.
Clientset
,
numberOfClients
)
internalClients
:=
make
([]
internalclientset
.
Interface
,
numberOfClients
)
for
i
:=
0
;
i
<
numberOfClients
;
i
++
{
for
i
:=
0
;
i
<
numberOfClients
;
i
++
{
config
,
err
:=
framework
.
LoadConfig
()
config
,
err
:=
framework
.
LoadConfig
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
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