Skip to content

Commit

Permalink
Provide some time for test to ingest metrics (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
otherview authored May 24, 2024
1 parent 516b3a8 commit 993fd4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions metrics/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net/http/httptest"
"strconv"
"testing"
"time"

"github.com/prometheus/common/expfmt"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -77,6 +78,8 @@ func TestPromMetrics(t *testing.T) {
totalGaugeVec += i
}

time.Sleep(time.Second) // might take a sec until the metrics are avail in the http handler

// Make a request to the metrics endpoint
resp, err := http.Get(server.URL + "/metrics")
if err != nil {
Expand Down

0 comments on commit 993fd4c

Please sign in to comment.