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
ede2e756
Commit
ede2e756
authored
Apr 07, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix density test
parent
0400339d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
68 deletions
+61
-68
density.go
test/e2e/density.go
+61
-68
No files found.
test/e2e/density.go
View file @
ede2e756
...
@@ -212,83 +212,76 @@ var _ = Describe("Density", func() {
...
@@ -212,83 +212,76 @@ var _ = Describe("Density", func() {
type
Density
struct
{
type
Density
struct
{
skip
bool
skip
bool
totalPods
int
podsPerMinion
int
podsPerMinion
int
rcsPerThread
int
}
}
//This test should always run, even if larger densities are skipped.
densityTests
:=
[]
Density
{
d3
:=
Density
{
totalPods
:
3
,
podsPerMinion
:
0
,
rcsPerThread
:
1
,
skip
:
false
}
// This test should always run, even if larger densities are skipped.
{
podsPerMinion
:
3
,
skip
:
false
},
//These tests are varied and customizable.
// TODO (wojtek-t):don't skip d30 after #6059
//TODO (wojtek-t):don't skip d30 after #6059
{
podsPerMinion
:
30
,
skip
:
true
},
d30
:=
Density
{
totalPods
:
30
,
podsPerMinion
:
0
,
rcsPerThread
:
1
,
skip
:
true
}
{
podsPerMinion
:
50
,
skip
:
true
},
d50
:=
Density
{
totalPods
:
50
,
podsPerMinion
:
0
,
rcsPerThread
:
1
,
skip
:
true
}
{
podsPerMinion
:
100
,
skip
:
true
},
d100
:=
Density
{
totalPods
:
100
,
podsPerMinion
:
0
,
rcsPerThread
:
1
,
skip
:
true
}
}
d500t5
:=
Density
{
totalPods
:
500
,
podsPerMinion
:
10
,
rcsPerThread
:
5
,
skip
:
true
}
d500t25
:=
Density
{
totalPods
:
500
,
podsPerMinion
:
10
,
rcsPerThread
:
25
,
skip
:
true
}
dtests
:=
[]
Density
{
d3
,
d30
,
d50
,
d100
,
d500t5
,
d500t25
}
for
_
,
testArg
:=
range
densityTests
{
name
:=
fmt
.
Sprintf
(
"should allow starting %d pods per node"
,
testArg
.
podsPerMinion
)
if
testArg
.
skip
{
name
=
"[Skipped] "
+
name
}
itArg
:=
testArg
It
(
name
,
func
()
{
totalPods
:=
itArg
.
podsPerMinion
*
minionCount
RCName
=
"my-hostname-density"
+
strconv
.
Itoa
(
totalPods
)
+
"-"
+
string
(
util
.
NewUUID
())
RunRC
(
c
,
RCName
,
ns
,
"gcr.io/google_containers/pause:go"
,
totalPods
)
})
}
//Run each test in the array which isn't skipped.
type
Scalability
struct
{
for
i
:=
range
dtests
{
skip
bool
totalPods
int
podsPerMinion
int
rcsPerThread
int
}
//cannot do a range iterator over structs.
scalabilityTests
:=
[]
Scalability
{
dtest
:=
dtests
[
i
]
{
totalPods
:
500
,
podsPerMinion
:
10
,
rcsPerThread
:
5
,
skip
:
true
},
{
totalPods
:
500
,
podsPerMinion
:
10
,
rcsPerThread
:
25
,
skip
:
true
},
}
//if ppm==0, its a raw density test.
for
_
,
testArg
:=
range
scalabilityTests
{
//otherwise, we continue launching n nodes per pod in threads till we meet the totalPods #.
// # of threads calibrate to totalPods
if
dtest
.
podsPerMinion
==
0
{
threads
:=
(
testArg
.
totalPods
/
(
testArg
.
podsPerMinion
*
testArg
.
rcsPerThread
))
//basic density tests
name
:=
fmt
.
Sprintf
(
"should allow starting %d pods per node"
,
dtest
.
totalPods
)
if
dtest
.
skip
{
name
:=
fmt
.
Sprintf
(
name
=
"[Skipped] "
+
name
"should be able to launch %v pods, %v per minion, in %v rcs/thread."
,
}
testArg
.
totalPods
,
testArg
.
podsPerMinion
,
testArg
.
rcsPerThread
)
It
(
name
,
func
()
{
if
testArg
.
skip
{
glog
.
Info
(
"Density test parameters: %v"
,
dtest
)
name
=
"[Skipped] "
+
name
RCName
=
"my-hostname-density"
+
strconv
.
Itoa
(
dtest
.
totalPods
)
+
"-"
+
string
(
util
.
NewUUID
())
}
RunRC
(
c
,
RCName
,
ns
,
"gcr.io/google_containers/pause:go"
,
dtest
.
totalPods
)
})
}
else
{
// # of threads calibrate to totalPods
threads
:=
(
dtest
.
totalPods
/
(
dtest
.
podsPerMinion
*
dtest
.
rcsPerThread
))
name
:=
fmt
.
Sprintf
(
"[Skipped] should be able to launch %v pods, %v per minion, in %v rcs/thread."
,
dtest
.
totalPods
,
dtest
.
podsPerMinion
,
dtest
.
rcsPerThread
)
if
dtest
.
skip
{
name
=
"[Skipped] "
+
name
}
itArg
:=
testArg
It
(
name
,
func
()
{
podsLaunched
:=
0
podsLaunched
:=
0
It
(
name
,
func
()
{
var
wg
sync
.
WaitGroup
wg
.
Add
(
threads
)
var
wg
sync
.
WaitGroup
// Create queue of pending requests on the api server.
//count down latch.., once all threads are launched, we wait for
for
i
:=
0
;
i
<
threads
;
i
++
{
//it to decrement down to zero.
go
func
()
{
wg
.
Add
(
threads
)
defer
wg
.
Done
()
for
i
:=
0
;
i
<
itArg
.
rcsPerThread
;
i
++
{
//create queue of pending requests on the api server.
name
:=
"my-short-lived-pod"
+
string
(
util
.
NewUUID
())
for
i
:=
0
;
i
<
threads
;
i
++
{
n
:=
itArg
.
podsPerMinion
*
minionCount
go
func
()
{
RunRC
(
c
,
name
,
ns
,
"gcr.io/google_containers/pause:go"
,
n
)
// call to wg.Done will serve as a count down latch.
podsLaunched
+=
n
defer
wg
.
Done
()
glog
.
Info
(
"Launched %v pods so far..."
,
podsLaunched
)
for
i
:=
0
;
i
<
dtest
.
rcsPerThread
;
i
++
{
}
name
:=
"my-short-lived-pod"
+
string
(
util
.
NewUUID
())
}()
n
:=
dtest
.
podsPerMinion
*
minionCount
}
RunRC
(
c
,
name
,
ns
,
"gcr.io/google_containers/pause:go"
,
n
)
// Wait for all the pods from all the RC's to return.
podsLaunched
+=
n
wg
.
Wait
()
glog
.
Info
(
"Launched %v pods so far..."
,
podsLaunched
)
glog
.
Info
(
"%v pods out of %v launched"
,
podsLaunched
,
itArg
.
totalPods
)
}
})
}()
}
//Wait for all the pods from all the RC's to return.
wg
.
Wait
()
glog
.
Info
(
"%v pods out of %v launched"
,
podsLaunched
,
dtest
.
totalPods
)
})
}
}
}
})
})
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