Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Jan 10, 2024
1 parent 8420cf8 commit cf4cd5b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@ import (
io_prometheus_client "github.com/prometheus/client_model/go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/metric/noop"
)

func TestProcessTelemetryWithHostProc(t *testing.T) {
tel := setupTelemetry(t)
// Make the sure the environment variable value is not used.
t.Setenv("HOST_PROC", "foo/bar")

require.NoError(t, RegisterProcessMetrics(noop.NewMeterProvider(), 0, WithHostProc("/proc")))
require.NoError(t, RegisterProcessMetrics(tel.MeterProvider, 0, WithHostProc("/proc")))

// Check that the metrics are actually filled.
time.Sleep(200 * time.Millisecond)

tel := setupTelemetry(t)

require.NoError(t, RegisterProcessMetrics(tel.MeterProvider, 0))

mp, err := fetchPrometheusMetrics(tel.promHandler)
require.NoError(t, err)

Expand Down

0 comments on commit cf4cd5b

Please sign in to comment.