Skip to content

Commit

Permalink
[chore][receiver/sapm] remove use of ReportFatalError (#31100)
Browse files Browse the repository at this point in the history
**Description:**
remove use of `ReportFatalError`

**Link to tracking Issue:**
Fixes #30597
  • Loading branch information
atoulme authored Feb 8, 2024
1 parent 3eb64ae commit 1ad99ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions receiver/sapmreceiver/trace_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/signalfx/sapm-proto/sapmprotocol"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/configtls"
Expand Down Expand Up @@ -243,15 +244,16 @@ func compressZstd(reqBytes []byte) ([]byte, error) {

func setupReceiver(t *testing.T, config *Config, sink *consumertest.TracesSink) receiver.Traces {
params := receivertest.NewNopCreateSettings()
params.TelemetrySettings.ReportStatus = func(event *component.StatusEvent) {
require.NoError(t, event.Err())
}
sr, err := newReceiver(params, config, sink)
assert.NoError(t, err, "should not have failed to create the SAPM receiver")
t.Log("Starting")

require.NoError(t, sr.Start(context.Background(), componenttest.NewNopHost()), "should not have failed to start trace reception")
require.NoError(t, sr.Start(context.Background(), componenttest.NewNopHost()), "should not fail to start log on second Start call")

// If there are errors reported through host.ReportFatalError() this will retrieve it.
<-time.After(500 * time.Millisecond)
t.Log("Trace Reception Started")
return sr
}
Expand Down

0 comments on commit 1ad99ae

Please sign in to comment.