Skip to content

Commit d6578d5

Browse files
committed
wip
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
1 parent 2a29d36 commit d6578d5

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

integration/main_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ func TestIntegration(t *testing.T) {
3535
}()
3636
t.Cleanup(func() { _ = server.Close() })
3737

38+
// Health check to ensure the server is up before starting tests.
39+
require.Eventually(t, func() bool {
40+
resp, err := http.Get("http://localhost:1234/uuid")
41+
if err != nil {
42+
t.Logf("httpbin server not ready yet: %v", err)
43+
return false
44+
}
45+
defer func() {
46+
_ = resp.Body.Close()
47+
}()
48+
return resp.StatusCode == 200
49+
}, 10*time.Second, 500*time.Millisecond)
50+
3851
// Create a directory for the access logs to be written to.
3952
accessLogsDir := cwd + "/access_logs"
4053
require.NoError(t, os.RemoveAll(accessLogsDir))

0 commit comments

Comments
 (0)