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
3806d386
Commit
3806d386
authored
Mar 08, 2017
by
David Ashpole
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use default timeout for deletion
parent
98ae5722
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
25 deletions
+20
-25
pods.go
test/e2e/common/pods.go
+1
-1
pods.go
test/e2e/framework/pods.go
+2
-0
util.go
test/e2e/framework/util.go
+3
-6
generated_clientset.go
test/e2e/generated_clientset.go
+1
-1
critical_pod_test.go
test/e2e_node/critical_pod_test.go
+4
-4
disk_eviction_test.go
test/e2e_node/disk_eviction_test.go
+3
-6
garbage_collector_test.go
test/e2e_node/garbage_collector_test.go
+1
-1
gpus.go
test/e2e_node/gpus.go
+2
-3
inode_eviction_test.go
test/e2e_node/inode_eviction_test.go
+1
-1
lifecycle_hook_test.go
test/e2e_node/lifecycle_hook_test.go
+2
-2
No files found.
test/e2e/common/pods.go
View file @
3806d386
...
...
@@ -234,7 +234,7 @@ var _ = framework.KubeDescribe("Pods", func() {
By
(
"verifying pod deletion was observed"
)
deleted
:=
false
var
lastPod
*
v1
.
Pod
timer
:=
time
.
After
(
2
*
time
.
Minute
)
timer
:=
time
.
After
(
framework
.
DefaultPodDeletionTimeout
)
for
!
deleted
{
select
{
case
event
,
_
:=
<-
w
.
ResultChan
()
:
...
...
test/e2e/framework/pods.go
View file @
3806d386
...
...
@@ -37,6 +37,8 @@ import (
.
"github.com/onsi/gomega"
)
const
DefaultPodDeletionTimeout
=
3
*
time
.
Minute
// ImageWhiteList is the images used in the current test suite. It should be initialized in test suite and
// the images in the white list should be pre-pulled in the test suite. Currently, this is only used by
// node e2e test.
...
...
test/e2e/framework/util.go
View file @
3806d386
...
...
@@ -103,9 +103,6 @@ const (
// TODO: Make this 30 seconds once #4566 is resolved.
PodStartTimeout
=
5
*
time
.
Minute
// How long to wait for the pod to no longer be running
podNoLongerRunningTimeout
=
30
*
time
.
Second
// If there are any orphaned namespaces to clean up, this test is running
// on a long lived cluster. A long wait here is preferably to spurious test
// failures caused by leaked resources from a previous test run.
...
...
@@ -1252,10 +1249,10 @@ func podRunning(c clientset.Interface, podName, namespace string) wait.Condition
}
}
// Waits default amount of time (
podNoLongerRunning
Timeout) for the specified pod to stop running.
// Waits default amount of time (
DefaultPodDeletion
Timeout) for the specified pod to stop running.
// Returns an error if timeout occurs first.
func
WaitForPodNoLongerRunningInNamespace
(
c
clientset
.
Interface
,
podName
,
namespace
string
)
error
{
return
WaitTimeoutForPodNoLongerRunningInNamespace
(
c
,
podName
,
namespace
,
podNoLongerRunning
Timeout
)
return
WaitTimeoutForPodNoLongerRunningInNamespace
(
c
,
podName
,
namespace
,
DefaultPodDeletion
Timeout
)
}
func
WaitTimeoutForPodNoLongerRunningInNamespace
(
c
clientset
.
Interface
,
podName
,
namespace
string
,
timeout
time
.
Duration
)
error
{
...
...
@@ -2214,7 +2211,7 @@ func (f *Framework) MatchContainerOutput(
createdPod
:=
podClient
.
Create
(
pod
)
defer
func
()
{
By
(
"delete the pod"
)
podClient
.
DeleteSync
(
createdPod
.
Name
,
&
metav1
.
DeleteOptions
{},
podNoLongerRunning
Timeout
)
podClient
.
DeleteSync
(
createdPod
.
Name
,
&
metav1
.
DeleteOptions
{},
DefaultPodDeletion
Timeout
)
}()
// Wait for client pod to complete.
...
...
test/e2e/generated_clientset.go
View file @
3806d386
...
...
@@ -102,7 +102,7 @@ func observeCreation(w watch.Interface) {
func
observeObjectDeletion
(
w
watch
.
Interface
)
(
obj
runtime
.
Object
)
{
deleted
:=
false
timeout
:=
false
timer
:=
time
.
After
(
60
*
time
.
Second
)
timer
:=
time
.
After
(
framework
.
DefaultPodDeletionTimeout
)
for
!
deleted
&&
!
timeout
{
select
{
case
event
,
_
:=
<-
w
.
ResultChan
()
:
...
...
test/e2e_node/critical_pod_test.go
View file @
3806d386
...
...
@@ -94,10 +94,10 @@ var _ = framework.KubeDescribe("CriticalPod [Serial] [Disruptive]", func() {
})
AfterEach
(
func
()
{
// Delete Pods
f
.
PodClient
()
.
DeleteSync
(
guaranteedPodName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
burstablePodName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
bestEffortPodName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
f
.
PodClientNS
(
kubeapi
.
NamespaceSystem
)
.
DeleteSyncInNamespace
(
criticalPodName
,
kubeapi
.
NamespaceSystem
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
guaranteedPodName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
burstablePodName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
bestEffortPodName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
f
.
PodClientNS
(
kubeapi
.
NamespaceSystem
)
.
DeleteSyncInNamespace
(
criticalPodName
,
kubeapi
.
NamespaceSystem
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
// Log Events
logPodEvents
(
f
)
logNodeEvents
(
f
)
...
...
test/e2e_node/disk_eviction_test.go
View file @
3806d386
...
...
@@ -35,9 +35,6 @@ const (
// podCheckInterval is the interval seconds between pod status checks.
podCheckInterval
=
time
.
Second
*
2
// podDisappearTimeout is the timeout to wait node disappear.
podDisappearTimeout
=
time
.
Minute
*
2
// containerGCPeriod is the period of container garbage collect loop. It should be the same
// with ContainerGCPeriod in kubelet.go. However we don't want to include kubelet package
// directly which will introduce a lot more dependencies.
...
...
@@ -97,9 +94,9 @@ var _ = framework.KubeDescribe("Kubelet Eviction Manager [Serial] [Disruptive]",
if
!
isImageSupported
()
||
!
evictionOptionIsSet
()
{
// Skip the after each
return
}
podClient
.
DeleteSync
(
busyPodName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
podClient
.
DeleteSync
(
idlePodName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
podClient
.
DeleteSync
(
verifyPodName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
podClient
.
DeleteSync
(
busyPodName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
podClient
.
DeleteSync
(
idlePodName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
podClient
.
DeleteSync
(
verifyPodName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
// Wait for 2 container gc loop to ensure that the containers are deleted. The containers
// created in this test consume a lot of disk, we don't want them to trigger disk eviction
...
...
test/e2e_node/garbage_collector_test.go
View file @
3806d386
...
...
@@ -231,7 +231,7 @@ func containerGCTest(f *framework.Framework, test testRun) {
AfterEach
(
func
()
{
for
_
,
pod
:=
range
test
.
testPods
{
By
(
fmt
.
Sprintf
(
"Deleting Pod %v"
,
pod
.
podName
))
f
.
PodClient
()
.
DeleteSync
(
pod
.
podName
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
pod
.
podName
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
}
By
(
"Making sure all containers get cleaned up"
)
...
...
test/e2e_node/gpus.go
View file @
3806d386
...
...
@@ -18,7 +18,6 @@ package e2e_node
import
(
"fmt"
"time"
"k8s.io/apimachinery/pkg/api/resource"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
...
...
@@ -98,10 +97,10 @@ var _ = framework.KubeDescribe("GPU [Serial]", func() {
deleteOptions
:=
metav1
.
DeleteOptions
{
GracePeriodSeconds
:
&
gp
,
}
f
.
PodClient
()
.
DeleteSync
(
podSuccess
.
Name
,
&
deleteOptions
,
30
*
time
.
Second
)
f
.
PodClient
()
.
DeleteSync
(
podSuccess
.
Name
,
&
deleteOptions
,
framework
.
DefaultPodDeletionTimeout
)
By
(
"attempting to start the failed pod again"
)
f
.
PodClient
()
.
DeleteSync
(
podFailure
.
Name
,
&
deleteOptions
,
10
*
time
.
Second
)
f
.
PodClient
()
.
DeleteSync
(
podFailure
.
Name
,
&
deleteOptions
,
framework
.
DefaultPodDeletionTimeout
)
podFailure
=
f
.
PodClient
()
.
CreateSync
(
podFailure
)
By
(
"Checking if the pod outputted Success to its logs"
)
...
...
test/e2e_node/inode_eviction_test.go
View file @
3806d386
...
...
@@ -289,7 +289,7 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
By
(
"deleting pods"
)
for
_
,
spec
:=
range
podTestSpecs
{
By
(
fmt
.
Sprintf
(
"deleting pod: %s"
,
spec
.
pod
.
Name
))
f
.
PodClient
()
.
DeleteSync
(
spec
.
pod
.
Name
,
&
metav1
.
DeleteOptions
{},
podDisappear
Timeout
)
f
.
PodClient
()
.
DeleteSync
(
spec
.
pod
.
Name
,
&
metav1
.
DeleteOptions
{},
framework
.
DefaultPodDeletion
Timeout
)
}
if
CurrentGinkgoTestDescription
()
.
Failed
{
...
...
test/e2e_node/lifecycle_hook_test.go
View file @
3806d386
...
...
@@ -60,7 +60,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() {
podClient
.
WaitForSuccess
(
podCheckHook
.
Name
,
postStartWaitTimeout
)
}
By
(
"delete the pod with lifecycle hook"
)
podClient
.
DeleteSync
(
podWithHook
.
Name
,
metav1
.
NewDeleteOptions
(
15
),
podWait
Timeout
)
podClient
.
DeleteSync
(
podWithHook
.
Name
,
metav1
.
NewDeleteOptions
(
15
),
framework
.
DefaultPodDeletion
Timeout
)
if
podWithHook
.
Spec
.
Containers
[
0
]
.
Lifecycle
.
PreStop
!=
nil
{
By
(
"create the hook check pod"
)
podClient
.
Create
(
podCheckHook
)
...
...
@@ -144,7 +144,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() {
},
postStartWaitTimeout
,
podCheckInterval
)
.
Should
(
BeNil
())
}
By
(
"delete the pod with lifecycle hook"
)
podClient
.
DeleteSync
(
podWithHook
.
Name
,
metav1
.
NewDeleteOptions
(
15
),
podWait
Timeout
)
podClient
.
DeleteSync
(
podWithHook
.
Name
,
metav1
.
NewDeleteOptions
(
15
),
framework
.
DefaultPodDeletion
Timeout
)
if
podWithHook
.
Spec
.
Containers
[
0
]
.
Lifecycle
.
PreStop
!=
nil
{
By
(
"check prestop hook"
)
Eventually
(
func
()
error
{
...
...
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