Skip to content

Commit

Permalink
[integration] - added connectivity polling to ensure connection to se…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
LeonLiur committed Jul 23, 2024
1 parent c3d5d7f commit c5e6299
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion integration/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"bytes"
"fmt"
"github.com/synnaxlabs/x/errors"
"net/http"
"os/exec"
"time"

"github.com/synnaxlabs/x/errors"
"github.com/synnaxlabs/x/telem"
)

Expand Down Expand Up @@ -53,6 +54,15 @@ func startCluster(p ClusterParam) (error, *bytes.Buffer, *bytes.Buffer, func() e
}

time.Sleep(5 * telem.Second.Duration())
client := &http.Client{}
resp, err := client.Post("http://localhost:9090/api/v1/connectivity/check", "", nil)
if err != nil {
return errors.Wrap(err, "server did not start properly"),
&stdOut,
&stdErr,
func() error { return nil }
}
defer resp.Body.Close()

return nil, &stdOut, &stdErr, func() (err error) {
const stopKeyword = "stop"
Expand Down

0 comments on commit c5e6299

Please sign in to comment.