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
0cda99b8
Commit
0cda99b8
authored
May 17, 2016
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing TestCascadingDeletion flake
parent
21706384
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
garbage_collector_test.go
test/integration/garbage_collector_test.go
+18
-1
No files found.
test/integration/garbage_collector_test.go
View file @
0cda99b8
...
@@ -195,12 +195,29 @@ func TestCascadingDeletion(t *testing.T) {
...
@@ -195,12 +195,29 @@ func TestCascadingDeletion(t *testing.T) {
if
err
:=
rcClient
.
Delete
(
toBeDeletedRCName
,
nil
);
err
!=
nil
{
if
err
:=
rcClient
.
Delete
(
toBeDeletedRCName
,
nil
);
err
!=
nil
{
t
.
Fatalf
(
"failed to delete replication controller: %v"
,
err
)
t
.
Fatalf
(
"failed to delete replication controller: %v"
,
err
)
}
}
// wait for the garbage collector to drain its queue
// wait for the garbage collector to drain its queue
if
err
:=
wait
.
Poll
(
10
*
time
.
Second
,
120
*
time
.
Second
,
func
()
(
bool
,
error
)
{
if
err
:=
wait
.
Poll
(
10
*
time
.
Second
,
120
*
time
.
Second
,
func
()
(
bool
,
error
)
{
return
gc
.
QueuesDrained
(),
nil
return
gc
.
QueuesDrained
(),
nil
});
err
!=
nil
{
});
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
// sometimes the deletion of the RC takes long time to be observed by
// the gc, so wait for the garbage collector to observe the deletion of
// the toBeDeletedRC
if
err
:=
wait
.
Poll
(
10
*
time
.
Second
,
120
*
time
.
Second
,
func
()
(
bool
,
error
)
{
return
!
gc
.
GraphHasUID
([]
types
.
UID
{
toBeDeletedRC
.
ObjectMeta
.
UID
}),
nil
});
err
!=
nil
{
t
.
Fatal
(
err
)
}
// wait for the garbage collector to drain its queue again because it's
// possible it just processed the delete of the toBeDeletedRC.
if
err
:=
wait
.
Poll
(
10
*
time
.
Second
,
120
*
time
.
Second
,
func
()
(
bool
,
error
)
{
return
gc
.
QueuesDrained
(),
nil
});
err
!=
nil
{
t
.
Fatal
(
err
)
}
t
.
Logf
(
"garbage collector queues drained"
)
t
.
Logf
(
"garbage collector queues drained"
)
// checks the garbage collect doesn't delete pods it shouldn't do.
// checks the garbage collect doesn't delete pods it shouldn't do.
if
_
,
err
:=
podClient
.
Get
(
independentPodName
);
err
!=
nil
{
if
_
,
err
:=
podClient
.
Get
(
independentPodName
);
err
!=
nil
{
...
@@ -210,7 +227,7 @@ func TestCascadingDeletion(t *testing.T) {
...
@@ -210,7 +227,7 @@ func TestCascadingDeletion(t *testing.T) {
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
if
_
,
err
:=
podClient
.
Get
(
garbageCollectedPodName
);
err
==
nil
||
!
errors
.
IsNotFound
(
err
)
{
if
_
,
err
:=
podClient
.
Get
(
garbageCollectedPodName
);
err
==
nil
||
!
errors
.
IsNotFound
(
err
)
{
t
.
Fatalf
(
"expect pod %s to be garbage collected
"
,
garbageCollectedPodName
)
t
.
Fatalf
(
"expect pod %s to be garbage collected
, got err= %v"
,
garbageCollectedPodName
,
err
)
}
}
}
}
...
...
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