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
60a4c3c0
Unverified
Commit
60a4c3c0
authored
May 08, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76603 from changyaowei/generic_ut_fix
fix TestEventChannelFull random fail
parents
71bbabc3
850f4bbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
generic_test.go
pkg/kubelet/pleg/generic_test.go
+5
-3
No files found.
pkg/kubelet/pleg/generic_test.go
View file @
60a4c3c0
...
@@ -211,15 +211,17 @@ func TestEventChannelFull(t *testing.T) {
...
@@ -211,15 +211,17 @@ func TestEventChannelFull(t *testing.T) {
}},
}},
}
}
pleg
.
relist
()
pleg
.
relist
()
// event channel is full, discard events
allEvents
:=
[]
*
PodLifecycleEvent
{
expected
=
[]
*
PodLifecycleEvent
{
{
ID
:
"1234"
,
Type
:
ContainerRemoved
,
Data
:
"c1"
},
{
ID
:
"1234"
,
Type
:
ContainerRemoved
,
Data
:
"c1"
},
{
ID
:
"1234"
,
Type
:
ContainerDied
,
Data
:
"c2"
},
{
ID
:
"1234"
,
Type
:
ContainerDied
,
Data
:
"c2"
},
{
ID
:
"1234"
,
Type
:
ContainerStarted
,
Data
:
"c3"
},
{
ID
:
"1234"
,
Type
:
ContainerStarted
,
Data
:
"c3"
},
{
ID
:
"4567"
,
Type
:
ContainerRemoved
,
Data
:
"c1"
},
{
ID
:
"4567"
,
Type
:
ContainerRemoved
,
Data
:
"c1"
},
{
ID
:
"4567"
,
Type
:
ContainerStarted
,
Data
:
"c4"
},
}
}
// event channel is full, discard events
actual
=
getEventsFromChannel
(
ch
)
actual
=
getEventsFromChannel
(
ch
)
verifyEvents
(
t
,
expected
,
actual
)
assert
.
True
(
t
,
len
(
actual
)
==
4
,
"channel length should be 4"
)
assert
.
Subsetf
(
t
,
allEvents
,
actual
,
"actual events should in all events"
)
}
}
func
TestDetectingContainerDeaths
(
t
*
testing
.
T
)
{
func
TestDetectingContainerDeaths
(
t
*
testing
.
T
)
{
...
...
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