Skip to content

Commit 123d1a9

Browse files
committed
modify random failure
1 parent 117160a commit 123d1a9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/kubelet/pleg/generic_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,17 @@ func TestEventChannelFull(t *testing.T) {
217217
{ID: "1234", Type: ContainerDied, Data: "c2"},
218218
{ID: "1234", Type: ContainerStarted, Data: "c3"},
219219
{ID: "4567", Type: ContainerRemoved, Data: "c1"},
220+
{ID: "4567", Type: ContainerStarted, Data: "c4"},
220221
}
221222
actual = getEventsFromChannel(ch)
222-
verifyEvents(t, expected, actual)
223+
assert.True(t, len(actual) == 4, "channel length should be 4")
224+
for _, actualEvent := range actual {
225+
for _, expectedEvent := range expected {
226+
if actualEvent.ID == expectedEvent.ID && actualEvent.Data == expectedEvent.Data {
227+
assert.True(t, actualEvent.Type == expectedEvent.Type, "event type should be equal")
228+
}
229+
}
230+
}
223231
}
224232

225233
func TestDetectingContainerDeaths(t *testing.T) {

0 commit comments

Comments
 (0)