mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: wait server to listen the http port (#29076)
issue: #29068 master pr: #29075 wait server to listen the http port then check whether various urls can be accessed normally Signed-off-by: PowderLi <min.li@zilliz.com>
This commit is contained in:
parent
4334e4e7ad
commit
04d351e4bb
@ -22,10 +22,12 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"go.uber.org/zap"
|
||||
@ -43,6 +45,13 @@ type HTTPServerTestSuite struct {
|
||||
func (suite *HTTPServerTestSuite) SetupSuite() {
|
||||
paramtable.Init()
|
||||
ServeHTTP()
|
||||
conn, err := net.DialTimeout("tcp", "localhost:"+DefaultListenPort, time.Second*5)
|
||||
if err != nil {
|
||||
time.Sleep(time.Second)
|
||||
conn, err = net.DialTimeout("tcp", "localhost:"+DefaultListenPort, time.Second*5)
|
||||
}
|
||||
suite.Equal(nil, err)
|
||||
conn.Close()
|
||||
}
|
||||
|
||||
func (suite *HTTPServerTestSuite) TearDownSuite() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user