add grpc streaming test
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
fb33535995
commit
78c4a8e9ff
@ -177,7 +177,13 @@ func TestGRPCClient(t *testing.T) {
|
|||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
fmt.Printf("recv from stream\n")
|
fmt.Printf("recv from stream\n")
|
||||||
if err = stream.Recv(rsp); err != nil {
|
if err = stream.Recv(rsp); err != nil {
|
||||||
t.Fatal(err)
|
st, ok := status.FromError(err)
|
||||||
|
if !ok {
|
||||||
|
t.Fatalf("%v", err)
|
||||||
|
}
|
||||||
|
if st.Code() != codes.DeadlineExceeded {
|
||||||
|
t.Fatalf("%v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if rsp.Msg != "test name" {
|
if rsp.Msg != "test name" {
|
||||||
t.Fatalf("invalid msg: %v", rsp)
|
t.Fatalf("invalid msg: %v", rsp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user