Skip to content

Commit

Permalink
fix: wait until server starts
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina-Sakai committed Feb 12, 2025
1 parent 047444c commit 15abc89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/generic/grpcjson_test/generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ func getJsonThriftGeneric(idl string, enableDynamicgo bool) (generic.Generic, er

func initMockTestServer(handler kt.TestService, address string) server.Server {
addr, _ := net.ResolveTCPAddr("tcp", address)
return newMockServer(handler, addr)
svr := newMockServer(handler, addr)
test.WaitServerStart(addr.String())
return svr
}

func testClientStreaming(t *testing.T, ctx context.Context, cli genericclient.Client) {
Expand Down
4 changes: 3 additions & 1 deletion pkg/generic/grpcjsonpb_test/generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ func initStreamingClient(t *testing.T, ctx context.Context, addr, idl string, cl

func initMockTestServer(handler mock.Mock, address string) server.Server {
addr, _ := net.ResolveTCPAddr("tcp", address)
return newMockTestServer(handler, addr)
svr := newMockTestServer(handler, addr)
test.WaitServerStart(addr.String())
return svr
}

func Test_invocationContainsPackage(t *testing.T) {
Expand Down

0 comments on commit 15abc89

Please # to comment.