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
9f098a9c
Commit
9f098a9c
authored
May 16, 2017
by
David Ashpole
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add context around test
parent
32600927
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
allocatable_eviction_test.go
test/e2e_node/allocatable_eviction_test.go
+9
-3
inode_eviction_test.go
test/e2e_node/inode_eviction_test.go
+10
-10
No files found.
test/e2e_node/allocatable_eviction_test.go
View file @
9f098a9c
...
@@ -64,7 +64,9 @@ var _ = framework.KubeDescribe("AllocatableEviction [Slow] [Serial] [Disruptive]
...
@@ -64,7 +64,9 @@ var _ = framework.KubeDescribe("AllocatableEviction [Slow] [Serial] [Disruptive]
}
}
evictionTestTimeout
:=
40
*
time
.
Minute
evictionTestTimeout
:=
40
*
time
.
Minute
testCondition
:=
"Memory Pressure"
testCondition
:=
"Memory Pressure"
kubeletConfigUpdate
:=
func
(
initialConfig
*
componentconfig
.
KubeletConfiguration
)
{
Context
(
fmt
.
Sprintf
(
"when we run containers that should cause %s"
,
testCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
componentconfig
.
KubeletConfiguration
)
{
initialConfig
.
EvictionHard
=
"memory.available<10%"
initialConfig
.
EvictionHard
=
"memory.available<10%"
// Set large system and kube reserved values to trigger allocatable thresholds far before hard eviction thresholds.
// Set large system and kube reserved values to trigger allocatable thresholds far before hard eviction thresholds.
initialConfig
.
SystemReserved
=
componentconfig
.
ConfigurationMap
(
map
[
string
]
string
{
"memory"
:
"1Gi"
})
initialConfig
.
SystemReserved
=
componentconfig
.
ConfigurationMap
(
map
[
string
]
string
{
"memory"
:
"1Gi"
})
...
@@ -72,8 +74,12 @@ var _ = framework.KubeDescribe("AllocatableEviction [Slow] [Serial] [Disruptive]
...
@@ -72,8 +74,12 @@ var _ = framework.KubeDescribe("AllocatableEviction [Slow] [Serial] [Disruptive]
initialConfig
.
EnforceNodeAllocatable
=
[]
string
{
cm
.
NodeAllocatableEnforcementKey
}
initialConfig
.
EnforceNodeAllocatable
=
[]
string
{
cm
.
NodeAllocatableEnforcementKey
}
initialConfig
.
ExperimentalNodeAllocatableIgnoreEvictionThreshold
=
false
initialConfig
.
ExperimentalNodeAllocatableIgnoreEvictionThreshold
=
false
initialConfig
.
CgroupsPerQOS
=
true
initialConfig
.
CgroupsPerQOS
=
true
}
})
runEvictionTest
(
f
,
testCondition
,
podTestSpecs
,
evictionTestTimeout
,
hasMemoryPressure
,
kubeletConfigUpdate
)
// Place the remainder of the test within a context so that the kubelet config is set before and after the test.
Context
(
"With kubeconfig updated"
,
func
()
{
runEvictionTest
(
f
,
testCondition
,
podTestSpecs
,
evictionTestTimeout
,
hasMemoryPressure
)
})
})
})
})
// Returns TRUE if the node has Memory Pressure, FALSE otherwise
// Returns TRUE if the node has Memory Pressure, FALSE otherwise
...
...
test/e2e_node/inode_eviction_test.go
View file @
9f098a9c
...
@@ -113,11 +113,16 @@ var _ = framework.KubeDescribe("InodeEviction [Slow] [Serial] [Disruptive] [Flak
...
@@ -113,11 +113,16 @@ var _ = framework.KubeDescribe("InodeEviction [Slow] [Serial] [Disruptive] [Flak
}
}
evictionTestTimeout
:=
30
*
time
.
Minute
evictionTestTimeout
:=
30
*
time
.
Minute
testCondition
:=
"Disk Pressure due to Inodes"
testCondition
:=
"Disk Pressure due to Inodes"
kubeletConfigUpdate
:=
func
(
initialConfig
*
componentconfig
.
KubeletConfiguration
)
{
initialConfig
.
EvictionHard
=
"nodefs.inodesFree<50%"
}
runEvictionTest
(
f
,
testCondition
,
podTestSpecs
,
evictionTestTimeout
,
hasInodePressure
,
kubeletConfigUpdate
)
Context
(
fmt
.
Sprintf
(
"when we run containers that should cause %s"
,
testCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
componentconfig
.
KubeletConfiguration
)
{
initialConfig
.
EvictionHard
=
"nodefs.inodesFree<50%"
})
// Place the remainder of the test within a context so that the kubelet config is set before and after the test.
Context
(
"With kubeconfig updated"
,
func
()
{
runEvictionTest
(
f
,
testCondition
,
podTestSpecs
,
evictionTestTimeout
,
hasInodePressure
)
})
})
})
})
// Struct used by runEvictionTest that specifies the pod, and when that pod should be evicted, relative to other pods
// Struct used by runEvictionTest that specifies the pod, and when that pod should be evicted, relative to other pods
...
@@ -136,11 +141,7 @@ type podTestSpec struct {
...
@@ -136,11 +141,7 @@ type podTestSpec struct {
// It ensures that all lower evictionPriority pods are eventually evicted.
// It ensures that all lower evictionPriority pods are eventually evicted.
// runEvictionTest then cleans up the testing environment by deleting provided nodes, and ensures that testCondition no longer exists
// runEvictionTest then cleans up the testing environment by deleting provided nodes, and ensures that testCondition no longer exists
func
runEvictionTest
(
f
*
framework
.
Framework
,
testCondition
string
,
podTestSpecs
[]
podTestSpec
,
evictionTestTimeout
time
.
Duration
,
func
runEvictionTest
(
f
*
framework
.
Framework
,
testCondition
string
,
podTestSpecs
[]
podTestSpec
,
evictionTestTimeout
time
.
Duration
,
hasPressureCondition
func
(
*
framework
.
Framework
,
string
)
(
bool
,
error
),
updateFunction
func
(
initialConfig
*
componentconfig
.
KubeletConfiguration
))
{
hasPressureCondition
func
(
*
framework
.
Framework
,
string
)
(
bool
,
error
))
{
Context
(
fmt
.
Sprintf
(
"when we run containers that should cause %s"
,
testCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
updateFunction
)
BeforeEach
(
func
()
{
BeforeEach
(
func
()
{
By
(
"seting up pods to be used by tests"
)
By
(
"seting up pods to be used by tests"
)
for
_
,
spec
:=
range
podTestSpecs
{
for
_
,
spec
:=
range
podTestSpecs
{
...
@@ -301,7 +302,6 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
...
@@ -301,7 +302,6 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
time
.
Sleep
(
postTestConditionMonitoringPeriod
)
time
.
Sleep
(
postTestConditionMonitoringPeriod
)
}
}
})
})
})
}
}
// Returns TRUE if the node has disk pressure due to inodes exists on the node, FALSE otherwise
// Returns TRUE if the node has disk pressure due to inodes exists on the node, FALSE otherwise
...
...
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