Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leehinman committed Sep 25, 2024
1 parent 38715e2 commit bd0cbfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/filebeat/fbreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type filebeatReceiver struct {

func (fb *filebeatReceiver) Start(ctx context.Context, host component.Host) error {
go func() {
fb.beater.Run(fb.beat)
_ = fb.beater.Run(fb.beat)
}()
return nil
}
Expand Down
9 changes: 7 additions & 2 deletions x-pack/filebeat/fbreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ func TestNewReceiver(t *testing.T) {
countLogs = countLogs + ld.LogRecordCount()
return nil
})
assert.NoError(t, err, "Error creating log consumer")

r, err := createReceiver(context.Background(), receiverSettings, &config, logConsumer)
assert.NoErrorf(t, err, "Error creating receiver. Logs:\n %s", zapLogs.String())
r.Start(context.Background(), nil)
err = r.Start(context.Background(), nil)
assert.NoError(t, err, "Error starting filebeatreceiver")

assert.Eventuallyf(t, func() bool { return countLogs > 0 }, 60*time.Second, 1*time.Second, "consumed logs didn't increase\nCount: %d\nLogs: %s\n", countLogs, zapLogs.String())
r.Shutdown(context.Background())

err = r.Shutdown(context.Background())
assert.NoError(t, err, "Error shutting down filebeatreceiver")
}

0 comments on commit bd0cbfd

Please sign in to comment.