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
4e5b4e7e
Commit
4e5b4e7e
authored
Mar 08, 2017
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend timeouts in taints test to account for slow Pod deletions
parent
c38717b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
taints_test.go
test/e2e/taints_test.go
+13
-8
No files found.
test/e2e/taints_test.go
View file @
4e5b4e7e
...
@@ -134,6 +134,11 @@ func createTestController(cs clientset.Interface, observedDeletions chan struct{
...
@@ -134,6 +134,11 @@ func createTestController(cs clientset.Interface, observedDeletions chan struct{
go
controller
.
Run
(
stopCh
)
go
controller
.
Run
(
stopCh
)
}
}
const
(
KubeletPodDeletionDelaySeconds
=
60
AdditionalWaitPerDeleteSeconds
=
5
)
// Tests the behavior of NoExecuteTaintManager. Following scenarios are included:
// Tests the behavior of NoExecuteTaintManager. Following scenarios are included:
// - eviction of non-tolerating pods from a tainted node,
// - eviction of non-tolerating pods from a tainted node,
// - lack of eviction of tolerating pods from a tainted node,
// - lack of eviction of tolerating pods from a tainted node,
...
@@ -179,7 +184,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -179,7 +184,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
// Wait a bit
// Wait a bit
By
(
"Waiting for Pod to be deleted"
)
By
(
"Waiting for Pod to be deleted"
)
timeoutChannel
:=
time
.
NewTimer
(
10
*
time
.
Second
)
.
C
timeoutChannel
:=
time
.
NewTimer
(
time
.
Duration
(
KubeletPodDeletionDelaySeconds
+
AdditionalWaitPerDeleteSeconds
)
*
time
.
Second
)
.
C
select
{
select
{
case
<-
timeoutChannel
:
case
<-
timeoutChannel
:
framework
.
Failf
(
"Failed to evict Pod"
)
framework
.
Failf
(
"Failed to evict Pod"
)
...
@@ -211,7 +216,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -211,7 +216,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
// Wait a bit
// Wait a bit
By
(
"Waiting for Pod to be deleted"
)
By
(
"Waiting for Pod to be deleted"
)
timeoutChannel
:=
time
.
NewTimer
(
10
*
time
.
Second
)
.
C
timeoutChannel
:=
time
.
NewTimer
(
time
.
Duration
(
KubeletPodDeletionDelaySeconds
+
AdditionalWaitPerDeleteSeconds
)
*
time
.
Second
)
.
C
select
{
select
{
case
<-
timeoutChannel
:
case
<-
timeoutChannel
:
framework
.
Logf
(
"Pod wasn't evicted. Test successful"
)
framework
.
Logf
(
"Pod wasn't evicted. Test successful"
)
...
@@ -226,7 +231,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -226,7 +231,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
// 4. See if pod will get evicted after toleration time runs out
// 4. See if pod will get evicted after toleration time runs out
It
(
"eventually evict pod with finite tolerations from tainted nodes"
,
func
()
{
It
(
"eventually evict pod with finite tolerations from tainted nodes"
,
func
()
{
podName
:=
"taint-eviction-3"
podName
:=
"taint-eviction-3"
pod
:=
createPodForTaintsTest
(
true
,
5
,
podName
,
ns
)
pod
:=
createPodForTaintsTest
(
true
,
KubeletPodDeletionDelaySeconds
+
2
*
AdditionalWaitPerDeleteSeconds
,
podName
,
ns
)
observedDeletions
:=
make
(
chan
struct
{},
100
)
observedDeletions
:=
make
(
chan
struct
{},
100
)
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
createTestController
(
cs
,
observedDeletions
,
stopCh
,
podName
,
ns
)
createTestController
(
cs
,
observedDeletions
,
stopCh
,
podName
,
ns
)
...
@@ -244,7 +249,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -244,7 +249,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
// Wait a bit
// Wait a bit
By
(
"Waiting to see if a Pod won't be deleted"
)
By
(
"Waiting to see if a Pod won't be deleted"
)
timeoutChannel
:=
time
.
NewTimer
(
2
*
time
.
Second
)
.
C
timeoutChannel
:=
time
.
NewTimer
(
time
.
Duration
(
KubeletPodDeletionDelaySeconds
+
AdditionalWaitPerDeleteSeconds
)
*
time
.
Second
)
.
C
select
{
select
{
case
<-
timeoutChannel
:
case
<-
timeoutChannel
:
framework
.
Logf
(
"Pod wasn't evicted"
)
framework
.
Logf
(
"Pod wasn't evicted"
)
...
@@ -253,7 +258,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -253,7 +258,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
return
return
}
}
By
(
"Waiting for Pod to be deleted"
)
By
(
"Waiting for Pod to be deleted"
)
timeoutChannel
=
time
.
NewTimer
(
10
*
time
.
Second
)
.
C
timeoutChannel
=
time
.
NewTimer
(
time
.
Duration
(
KubeletPodDeletionDelaySeconds
+
AdditionalWaitPerDeleteSeconds
)
*
time
.
Second
)
.
C
select
{
select
{
case
<-
timeoutChannel
:
case
<-
timeoutChannel
:
framework
.
Failf
(
"Pod wasn't evicted"
)
framework
.
Failf
(
"Pod wasn't evicted"
)
...
@@ -270,7 +275,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -270,7 +275,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
// 5. See if Pod won't be evicted.
// 5. See if Pod won't be evicted.
It
(
"removing taint cancels eviction"
,
func
()
{
It
(
"removing taint cancels eviction"
,
func
()
{
podName
:=
"taint-eviction-4"
podName
:=
"taint-eviction-4"
pod
:=
createPodForTaintsTest
(
true
,
5
,
podName
,
ns
)
pod
:=
createPodForTaintsTest
(
true
,
2
*
AdditionalWaitPerDeleteSeconds
,
podName
,
ns
)
observedDeletions
:=
make
(
chan
struct
{},
100
)
observedDeletions
:=
make
(
chan
struct
{},
100
)
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
createTestController
(
cs
,
observedDeletions
,
stopCh
,
podName
,
ns
)
createTestController
(
cs
,
observedDeletions
,
stopCh
,
podName
,
ns
)
...
@@ -293,7 +298,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -293,7 +298,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
// Wait a bit
// Wait a bit
By
(
"Waiting short time to make sure Pod is queued for deletion"
)
By
(
"Waiting short time to make sure Pod is queued for deletion"
)
timeoutChannel
:=
time
.
NewTimer
(
2
*
time
.
Second
)
.
C
timeoutChannel
:=
time
.
NewTimer
(
AdditionalWaitPerDeleteSeconds
)
.
C
select
{
select
{
case
<-
timeoutChannel
:
case
<-
timeoutChannel
:
framework
.
Logf
(
"Pod wasn't evicted. Proceeding"
)
framework
.
Logf
(
"Pod wasn't evicted. Proceeding"
)
...
@@ -305,7 +310,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
...
@@ -305,7 +310,7 @@ var _ = framework.KubeDescribe("NoExecuteTaintManager [Serial]", func() {
framework
.
RemoveTaintOffNode
(
cs
,
nodeName
,
testTaint
)
framework
.
RemoveTaintOffNode
(
cs
,
nodeName
,
testTaint
)
taintRemoved
=
true
taintRemoved
=
true
By
(
"Waiting some time to make sure that toleration time passed."
)
By
(
"Waiting some time to make sure that toleration time passed."
)
timeoutChannel
=
time
.
NewTimer
(
10
*
time
.
Second
)
.
C
timeoutChannel
=
time
.
NewTimer
(
time
.
Duration
(
KubeletPodDeletionDelaySeconds
+
3
*
AdditionalWaitPerDeleteSeconds
)
*
time
.
Second
)
.
C
select
{
select
{
case
<-
timeoutChannel
:
case
<-
timeoutChannel
:
framework
.
Logf
(
"Pod wasn't evicted. Test successful"
)
framework
.
Logf
(
"Pod wasn't evicted. Test successful"
)
...
...
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