Skip to content

Commit

Permalink
UPSTREAM: 103612: tolerate additional, but congruent, events for inte…
Browse files Browse the repository at this point in the history
…gration test

OpenShift-Rebase-Source: 2f4c829

UPSTREAM: 103612: tolerate additional, but congruent, events for integration test
  • Loading branch information
deads2k authored and bertinatto committed Mar 6, 2024
1 parent ba187e8 commit e39da45
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/integration/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func TestEventCompatibility(t *testing.T) {
return false, err
}

if len(v1Events.Items) != 2 {
// Be sure that at least the events we sent in the test were delivered.
// To add any events from the kube-apiserver itself will require this tolerate additional events.
if len(v1Events.Items) < 2 {
return false, nil
}

Expand All @@ -88,9 +90,15 @@ func TestEventCompatibility(t *testing.T) {
return false, err
}

if len(events.Items) != 2 {
if len(events.Items) < 2 {
return false, nil
}

// Be sure that both APIs produce the same number of events.
if len(events.Items) != len(v1Events.Items) {
return false, nil
}

return true, nil
})
if err != nil {
Expand Down Expand Up @@ -137,15 +145,17 @@ func TestEventSeries(t *testing.T) {
return false, err
}

if len(events.Items) != 1 {
// Be sure that at least the events we sent in the test were delivered.
// To add any events from the kube-apiserver itself will require this tolerate additional events.
if len(events.Items) < 1 {
return false, nil
}

if events.Items[0].Series == nil {
return false, nil
}

if events.Items[0].Series.Count != 2 {
if events.Items[0].Series.Count < 2 {
return false, fmt.Errorf("expected EventSeries to have a starting count of 2, got: %d", events.Items[0].Series.Count)
}

Expand Down

0 comments on commit e39da45

Please sign in to comment.