mirror of https://github.com/grpc/grpc-go.git
tests: nix TestClientDoesntDeadlockWhileWritingErroneousLargeMessages (#6227)
This commit is contained in:
parent
e853dbf004
commit
da1a5eb25d
|
|
@ -5281,49 +5281,6 @@ func (s) TestStatusInvalidUTF8Details(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s) TestClientDoesntDeadlockWhileWritingErrornousLargeMessages(t *testing.T) {
|
||||
for _, e := range listTestEnv() {
|
||||
if e.httpHandler {
|
||||
continue
|
||||
}
|
||||
testClientDoesntDeadlockWhileWritingErrornousLargeMessages(t, e)
|
||||
}
|
||||
}
|
||||
|
||||
func testClientDoesntDeadlockWhileWritingErrornousLargeMessages(t *testing.T, e env) {
|
||||
te := newTest(t, e)
|
||||
te.userAgent = testAppUA
|
||||
smallSize := 1024
|
||||
te.maxServerReceiveMsgSize = &smallSize
|
||||
te.startServer(&testServer{security: e.security})
|
||||
defer te.tearDown()
|
||||
tc := testgrpc.NewTestServiceClient(te.clientConn())
|
||||
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 1048576)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
Payload: payload,
|
||||
}
|
||||
var wg sync.WaitGroup
|
||||
for i := 0; i < 10; i++ {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for j := 0; j < 100; j++ {
|
||||
ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Second*10))
|
||||
defer cancel()
|
||||
if _, err := tc.UnaryCall(ctx, req); status.Code(err) != codes.ResourceExhausted {
|
||||
t.Errorf("TestService/UnaryCall(_,_) = _. %v, want code: %s", err, codes.ResourceExhausted)
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func (s) TestRPCTimeout(t *testing.T) {
|
||||
for _, e := range listTestEnv() {
|
||||
testRPCTimeout(t, e)
|
||||
|
|
|
|||
Loading…
Reference in New Issue