Skip to content

Commit

Permalink
Fix broken unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed May 30, 2024
1 parent 3bceb1a commit 13e976d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/component/faro/receiver/receiver_otelcol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/grafana/alloy/internal/component/otelcol"
"github.com/grafana/alloy/internal/component/otelcol/auth"
"github.com/grafana/alloy/internal/component/otelcol/auth/headers"
otelcolCfg "github.com/grafana/alloy/internal/component/otelcol/config"
otlphttp "github.com/grafana/alloy/internal/component/otelcol/exporter/otlphttp"
"github.com/grafana/alloy/internal/runtime/componenttest"
"github.com/grafana/alloy/internal/util"
Expand Down Expand Up @@ -61,12 +62,15 @@ func TestWithOtelcolConsumer(t *testing.T) {
Action: headers.ActionUpsert,
},
},
DebugMetrics: otelcolCfg.DebugMetricsArguments{
Level: otelcolCfg.LevelDetailed,
},
})
require.NoError(t, err)
}()

require.NoError(t, otelcolAuthHeader.WaitRunning(time.Second), "otelco.auth.headers never started")
require.NoError(t, otelcolAuthHeader.WaitExports(time.Second), "otelco.auth.headers never exported anything")
require.NoError(t, otelcolAuthHeader.WaitRunning(time.Second), "otelcol.auth.headers never started")
require.NoError(t, otelcolAuthHeader.WaitExports(time.Second), "otelcol.auth.headers never exported anything")
otelcolAuthHeaderExport, ok := otelcolAuthHeader.Exports().(auth.Exports)
require.True(t, ok)

Expand All @@ -81,6 +85,9 @@ func TestWithOtelcolConsumer(t *testing.T) {
},
}),
Encoding: otlphttp.EncodingJSON,
DebugMetrics: otelcolCfg.DebugMetricsArguments{
Level: otelcolCfg.LevelDetailed,
},
})
require.NoError(t, err)
}()
Expand Down

0 comments on commit 13e976d

Please sign in to comment.