Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato committed May 17, 2024
1 parent 647df28 commit cd214d6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions integrations/event-handler/teleport_events_watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ func TestEvents(t *testing.T) {
mockEventWatcher.setSearchEventsError(mockErr)

select {
case err := <-chErr:
require.Error(t, mockErr, err)
case err, ok := <-chErr:
require.True(t, ok, "Channel unexpectedly close")
require.ErrorIs(t, err, mockErr)
case <-time.After(2 * time.Second):
t.Fatalf("No events received within deadline")
}
Expand Down Expand Up @@ -340,8 +341,9 @@ func TestUpdatePage(t *testing.T) {
mockEventWatcher.setSearchEventsError(mockErr)

select {
case err := <-chErr:
require.Error(t, mockErr, err)
case err, ok := <-chErr:
require.True(t, ok, "Channel unexpectedly close")
require.ErrorIs(t, err, mockErr)
case <-time.After(2 * time.Second):
t.Fatalf("No events received within deadline")
}
Expand Down Expand Up @@ -594,8 +596,9 @@ func TestEventsWithWindowSkip(t *testing.T) {
mockEventWatcher.setSearchEventsError(mockErr)

select {
case err := <-chErr:
require.Error(t, mockErr, err)
case err, ok := <-chErr:
require.True(t, ok, "Channel unexpectedly close")
require.ErrorIs(t, err, mockErr)
case <-time.After(2 * time.Second):
t.Fatalf("No events received within deadline")
}
Expand Down

0 comments on commit cd214d6

Please sign in to comment.