Skip to content

Commit

Permalink
tests: nix TestClientDoesntDeadlockWhileWritingErroneousLargeMessages (
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindbr8 authored Apr 26, 2023
1 parent e853dbf commit da1a5eb
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions test/end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da1a5eb

Please sign in to comment.