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
19f73899
Commit
19f73899
authored
Feb 13, 2019
by
changyaowei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify test case
parent
c70ee427
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
generic_test.go
pkg/kubelet/pleg/generic_test.go
+9
-9
No files found.
pkg/kubelet/pleg/generic_test.go
View file @
19f73899
...
...
@@ -44,11 +44,11 @@ type TestGenericPLEG struct {
clock
*
clock
.
FakeClock
}
func
newTestGenericPLEG
WithLargeChannel
()
*
TestGenericPLEG
{
return
newTestGenericPLEG
(
largeChannelCap
)
func
newTestGenericPLEG
()
*
TestGenericPLEG
{
return
newTestGenericPLEG
WithChannelSize
(
largeChannelCap
)
}
func
newTestGenericPLEG
(
eventChannelCap
int
)
*
TestGenericPLEG
{
func
newTestGenericPLEG
WithChannelSize
(
eventChannelCap
int
)
*
TestGenericPLEG
{
fakeRuntime
:=
&
containertest
.
FakeRuntime
{}
clock
:=
clock
.
NewFakeClock
(
time
.
Time
{})
// The channel capacity should be large enough to hold all events in a
...
...
@@ -99,7 +99,7 @@ func verifyEvents(t *testing.T, expected, actual []*PodLifecycleEvent) {
}
func
TestRelisting
(
t
*
testing
.
T
)
{
testPleg
:=
newTestGenericPLEG
WithLargeChannel
()
testPleg
:=
newTestGenericPLEG
()
pleg
,
runtime
:=
testPleg
.
pleg
,
testPleg
.
runtime
ch
:=
pleg
.
Watch
()
// The first relist should send a PodSync event to each pod.
...
...
@@ -165,7 +165,7 @@ func TestRelisting(t *testing.T) {
// TestEventChannelFull test when channel is full, the events will be discard.
func
TestEventChannelFull
(
t
*
testing
.
T
)
{
testPleg
:=
newTestGenericPLEG
(
4
)
testPleg
:=
newTestGenericPLEG
WithChannelSize
(
4
)
pleg
,
runtime
:=
testPleg
.
pleg
,
testPleg
.
runtime
ch
:=
pleg
.
Watch
()
// The first relist should send a PodSync event to each pod.
...
...
@@ -233,7 +233,7 @@ func TestDetectingContainerDeaths(t *testing.T) {
}
func
testReportMissingContainers
(
t
*
testing
.
T
,
numRelists
int
)
{
testPleg
:=
newTestGenericPLEG
WithLargeChannel
()
testPleg
:=
newTestGenericPLEG
()
pleg
,
runtime
:=
testPleg
.
pleg
,
testPleg
.
runtime
ch
:=
pleg
.
Watch
()
runtime
.
AllPodList
=
[]
*
containertest
.
FakePod
{
...
...
@@ -274,7 +274,7 @@ func testReportMissingContainers(t *testing.T, numRelists int) {
}
func
testReportMissingPods
(
t
*
testing
.
T
,
numRelists
int
)
{
testPleg
:=
newTestGenericPLEG
WithLargeChannel
()
testPleg
:=
newTestGenericPLEG
()
pleg
,
runtime
:=
testPleg
.
pleg
,
testPleg
.
runtime
ch
:=
pleg
.
Watch
()
runtime
.
AllPodList
=
[]
*
containertest
.
FakePod
{
...
...
@@ -410,7 +410,7 @@ func TestRemoveCacheEntry(t *testing.T) {
}
func
TestHealthy
(
t
*
testing
.
T
)
{
testPleg
:=
newTestGenericPLEG
WithLargeChannel
()
testPleg
:=
newTestGenericPLEG
()
// pleg should initially be unhealthy
pleg
,
_
,
clock
:=
testPleg
.
pleg
,
testPleg
.
runtime
,
testPleg
.
clock
...
...
@@ -506,7 +506,7 @@ func TestRelistWithReinspection(t *testing.T) {
// Test detecting sandbox state changes.
func
TestRelistingWithSandboxes
(
t
*
testing
.
T
)
{
testPleg
:=
newTestGenericPLEG
WithLargeChannel
()
testPleg
:=
newTestGenericPLEG
()
pleg
,
runtime
:=
testPleg
.
pleg
,
testPleg
.
runtime
ch
:=
pleg
.
Watch
()
// The first relist should send a PodSync event to each pod.
...
...
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