Skip to content

Commit

Permalink
fix lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-taf committed Dec 17, 2024
1 parent 52ebf34 commit 87291c6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions comp/process/apiserver/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ func TestLifecycle(t *testing.T) {
settingsimpl.MockModule(),
))

assert.Eventually(t, func() bool {
res, err := http.Get("http://localhost:43424/config")
if err != nil {
return false
}
assert.EventuallyWithT(t, func(c *assert.CollectT) {
req, err := http.NewRequest("POST", "http://localhost:43424/config", nil)
require.NoError(c, err)
util.CreateAndSetAuthToken(pkgconfigsetup.Datadog())
req.Header.Set("Authorization", "Bearer "+util.GetAuthToken())
res, err := util.GetClient(false).Do(req)
require.NoError(c, err)
defer res.Body.Close()

return res.StatusCode == http.StatusOK
assert.Equal(c, http.StatusOK, res.StatusCode)
}, 5*time.Second, time.Second)
}

Expand Down

0 comments on commit 87291c6

Please sign in to comment.