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
0f0c754e
Commit
0f0c754e
authored
Mar 21, 2018
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of duplicate VerifyPodStartupLatency util in node density tests
parent
b0dd166f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
27 deletions
+17
-27
metrics_util.go
test/e2e/framework/metrics_util.go
+9
-10
density.go
test/e2e/scalability/density.go
+7
-1
density_test.go
test/e2e_node/density_test.go
+1
-16
No files found.
test/e2e/framework/metrics_util.go
View file @
0f0c754e
...
@@ -43,7 +43,6 @@ const (
...
@@ -43,7 +43,6 @@ const (
// NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node.
// NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node.
NodeStartupThreshold
=
4
*
time
.
Second
NodeStartupThreshold
=
4
*
time
.
Second
podStartupThreshold
time
.
Duration
=
5
*
time
.
Second
// We are setting 1s threshold for apicalls even in small clusters to avoid flakes.
// We are setting 1s threshold for apicalls even in small clusters to avoid flakes.
// The problem is that if long GC is happening in small clusters (where we have e.g.
// The problem is that if long GC is happening in small clusters (where we have e.g.
// 1-core master machines) and tests are pretty short, it may consume significant
// 1-core master machines) and tests are pretty short, it may consume significant
...
@@ -402,17 +401,17 @@ func HighLatencyRequests(c clientset.Interface, nodeCount int) (int, *APIRespons
...
@@ -402,17 +401,17 @@ func HighLatencyRequests(c clientset.Interface, nodeCount int) (int, *APIRespons
return
badMetrics
,
metrics
,
nil
return
badMetrics
,
metrics
,
nil
}
}
// Verifies whether 50, 90 and 99th percentiles of
e2e PodStartupLatency
are
// Verifies whether 50, 90 and 99th percentiles of
a latency metric
are
// within the threshold.
// within the
expected
threshold.
func
Verify
PodStartupLatency
(
latency
*
PodStartupLatency
)
error
{
func
Verify
LatencyWithinThreshold
(
threshold
,
actual
LatencyMetric
,
metricName
string
)
error
{
if
latency
.
E2ELatency
.
Perc50
>
podStartupThreshold
{
if
actual
.
Perc50
>
threshold
.
Perc50
{
return
fmt
.
Errorf
(
"too high
pod startup latency 50th percentile: %v"
,
latency
.
E2ELatency
.
Perc50
)
return
fmt
.
Errorf
(
"too high
%v latency 50th percentile: %v"
,
metricName
,
actual
.
Perc50
)
}
}
if
latency
.
E2ELatency
.
Perc90
>
podStartupThreshold
{
if
actual
.
Perc90
>
threshold
.
Perc90
{
return
fmt
.
Errorf
(
"too high
pod startup latency 90th percentile: %v"
,
latency
.
E2ELatency
.
Perc90
)
return
fmt
.
Errorf
(
"too high
%v latency 90th percentile: %v"
,
metricName
,
actual
.
Perc90
)
}
}
if
latency
.
E2ELatency
.
Perc99
>
podStartupThreshold
{
if
actual
.
Perc99
>
threshold
.
Perc99
{
return
fmt
.
Errorf
(
"too high
pod startup latency 99th percentile: %v"
,
latency
.
E2ELatency
.
Perc99
)
return
fmt
.
Errorf
(
"too high
%v latency 99th percentile: %v"
,
metricName
,
actual
.
Perc99
)
}
}
return
nil
return
nil
}
}
...
...
test/e2e/scalability/density.go
View file @
0f0c754e
...
@@ -50,6 +50,7 @@ import (
...
@@ -50,6 +50,7 @@ import (
)
)
const
(
const
(
PodStartupLatencyThreshold
=
5
*
time
.
Second
MinSaturationThreshold
=
2
*
time
.
Minute
MinSaturationThreshold
=
2
*
time
.
Minute
MinPodsPerSecondThroughput
=
8
MinPodsPerSecondThroughput
=
8
DensityPollInterval
=
10
*
time
.
Second
DensityPollInterval
=
10
*
time
.
Second
...
@@ -846,7 +847,12 @@ var _ = SIGDescribe("Density", func() {
...
@@ -846,7 +847,12 @@ var _ = SIGDescribe("Density", func() {
f
.
TestSummaries
=
append
(
f
.
TestSummaries
,
podStartupLatency
)
f
.
TestSummaries
=
append
(
f
.
TestSummaries
,
podStartupLatency
)
// Test whether e2e pod startup time is acceptable.
// Test whether e2e pod startup time is acceptable.
framework
.
ExpectNoError
(
framework
.
VerifyPodStartupLatency
(
podStartupLatency
))
podStartupLatencyThreshold
:=
framework
.
LatencyMetric
{
Perc50
:
PodStartupLatencyThreshold
,
Perc90
:
PodStartupLatencyThreshold
,
Perc99
:
PodStartupLatencyThreshold
,
}
framework
.
ExpectNoError
(
framework
.
VerifyLatencyWithinThreshold
(
podStartupLatencyThreshold
,
podStartupLatency
.
E2ELatency
,
"pod startup"
))
framework
.
LogSuspiciousLatency
(
startupLag
,
e2eLag
,
nodeCount
,
c
)
framework
.
LogSuspiciousLatency
(
startupLag
,
e2eLag
,
nodeCount
,
c
)
latencyMeasurementPhase
.
End
()
latencyMeasurementPhase
.
End
()
...
...
test/e2e_node/density_test.go
View file @
0f0c754e
...
@@ -472,21 +472,6 @@ func getPodStartLatency(node string) (framework.KubeletLatencyMetrics, error) {
...
@@ -472,21 +472,6 @@ func getPodStartLatency(node string) (framework.KubeletLatencyMetrics, error) {
return
latencyMetrics
,
nil
return
latencyMetrics
,
nil
}
}
// verifyPodStartupLatency verifies whether 50, 90 and 99th percentiles of PodStartupLatency are
// within the threshold.
func
verifyPodStartupLatency
(
expect
,
actual
framework
.
LatencyMetric
)
error
{
if
actual
.
Perc50
>
expect
.
Perc50
{
return
fmt
.
Errorf
(
"too high pod startup latency 50th percentile: %v"
,
actual
.
Perc50
)
}
if
actual
.
Perc90
>
expect
.
Perc90
{
return
fmt
.
Errorf
(
"too high pod startup latency 90th percentile: %v"
,
actual
.
Perc90
)
}
if
actual
.
Perc99
>
expect
.
Perc99
{
return
fmt
.
Errorf
(
"too high pod startup latency 99th percentile: %v"
,
actual
.
Perc99
)
}
return
nil
}
// newInformerWatchPod creates an informer to check whether all pods are running.
// newInformerWatchPod creates an informer to check whether all pods are running.
func
newInformerWatchPod
(
f
*
framework
.
Framework
,
mutex
*
sync
.
Mutex
,
watchTimes
map
[
string
]
metav1
.
Time
,
podType
string
)
cache
.
Controller
{
func
newInformerWatchPod
(
f
*
framework
.
Framework
,
mutex
*
sync
.
Mutex
,
watchTimes
map
[
string
]
metav1
.
Time
,
podType
string
)
cache
.
Controller
{
ns
:=
f
.
Namespace
.
Name
ns
:=
f
.
Namespace
.
Name
...
@@ -563,7 +548,7 @@ func logAndVerifyLatency(batchLag time.Duration, e2eLags []framework.PodLatencyD
...
@@ -563,7 +548,7 @@ func logAndVerifyLatency(batchLag time.Duration, e2eLags []framework.PodLatencyD
if
isVerify
{
if
isVerify
{
// check whether e2e pod startup time is acceptable.
// check whether e2e pod startup time is acceptable.
framework
.
ExpectNoError
(
verifyPodStartupLatency
(
podStartupLimits
,
podStartupLatency
))
framework
.
ExpectNoError
(
framework
.
VerifyLatencyWithinThreshold
(
podStartupLimits
,
podStartupLatency
,
"pod startup"
))
// check bactch pod creation latency
// check bactch pod creation latency
if
podBatchStartupLimit
>
0
{
if
podBatchStartupLimit
>
0
{
...
...
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