Skip to content

Commit 180fa5d

Browse files
fix(test): Wait in pprof test (#2576)
1 parent 2bb784c commit 180fa5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/relayproxy/api/routes_monitoring_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net/http"
77
"testing"
8+
"time"
89

910
"github.com/stretchr/testify/require"
1011
"github.com/thomaspoignant/go-feature-flag/cmd/relayproxy/api"
@@ -72,6 +73,7 @@ func TestPprofEndpointsStarts(t *testing.T) {
7273

7374
go apiServer.Start()
7475
defer apiServer.Stop(context.Background())
76+
time.Sleep(1 * time.Second) // waiting for the apiServer to start
7577
resp, err := http.Get(fmt.Sprintf("http://localhost:%d/debug/pprof/heap", portToCheck))
7678
require.NoError(t, err)
7779
require.Equal(t, tt.expectedStatusCode, resp.StatusCode)

0 commit comments

Comments
 (0)