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
10fa1ab2
Commit
10fa1ab2
authored
Aug 25, 2016
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the gc e2e test more strict
parent
d836b248
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
garbage_collector.go
test/e2e/garbage_collector.go
+16
-1
No files found.
test/e2e/garbage_collector.go
View file @
10fa1ab2
...
@@ -174,12 +174,14 @@ var _ = framework.KubeDescribe("Garbage collector", func() {
...
@@ -174,12 +174,14 @@ var _ = framework.KubeDescribe("Garbage collector", func() {
podClient
:=
clientSet
.
Core
()
.
Pods
(
f
.
Namespace
.
Name
)
podClient
:=
clientSet
.
Core
()
.
Pods
(
f
.
Namespace
.
Name
)
rcName
:=
"simpletest.rc"
rcName
:=
"simpletest.rc"
rc
:=
newOwnerRC
(
f
,
rcName
)
rc
:=
newOwnerRC
(
f
,
rcName
)
replicas
:=
int32
(
100
)
rc
.
Spec
.
Replicas
=
&
replicas
By
(
"create the rc"
)
By
(
"create the rc"
)
rc
,
err
:=
rcClient
.
Create
(
rc
)
rc
,
err
:=
rcClient
.
Create
(
rc
)
if
err
!=
nil
{
if
err
!=
nil
{
framework
.
Failf
(
"Failed to create replication controller: %v"
,
err
)
framework
.
Failf
(
"Failed to create replication controller: %v"
,
err
)
}
}
// wait for rc to create
some
pods
// wait for rc to create pods
if
err
:=
wait
.
Poll
(
5
*
time
.
Second
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
if
err
:=
wait
.
Poll
(
5
*
time
.
Second
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
rc
,
err
:=
rcClient
.
Get
(
rc
.
Name
)
rc
,
err
:=
rcClient
.
Get
(
rc
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -199,6 +201,19 @@ var _ = framework.KubeDescribe("Garbage collector", func() {
...
@@ -199,6 +201,19 @@ var _ = framework.KubeDescribe("Garbage collector", func() {
if
err
:=
rcClient
.
Delete
(
rc
.
ObjectMeta
.
Name
,
deleteOptions
);
err
!=
nil
{
if
err
:=
rcClient
.
Delete
(
rc
.
ObjectMeta
.
Name
,
deleteOptions
);
err
!=
nil
{
framework
.
Failf
(
"failed to delete the rc: %v"
,
err
)
framework
.
Failf
(
"failed to delete the rc: %v"
,
err
)
}
}
By
(
"wait for the rc to be deleted"
)
if
err
:=
wait
.
Poll
(
5
*
time
.
Second
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
rcs
,
err
:=
rcClient
.
List
(
api
.
ListOptions
{})
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Failed to list rcs: %v"
,
err
)
}
if
len
(
rcs
.
Items
)
!=
0
{
return
false
,
nil
}
return
true
,
nil
});
err
!=
nil
&&
err
!=
wait
.
ErrWaitTimeout
{
framework
.
Failf
(
"%v"
,
err
)
}
By
(
"wait for 30 seconds to see if the garbage collector mistakenly deletes the pods"
)
By
(
"wait for 30 seconds to see if the garbage collector mistakenly deletes the pods"
)
if
err
:=
wait
.
Poll
(
5
*
time
.
Second
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
if
err
:=
wait
.
Poll
(
5
*
time
.
Second
,
30
*
time
.
Second
,
func
()
(
bool
,
error
)
{
pods
,
err
:=
podClient
.
List
(
api
.
ListOptions
{})
pods
,
err
:=
podClient
.
List
(
api
.
ListOptions
{})
...
...
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