From 786724dc15f0dd1f6a808fe53ba5b31ac82add74 Mon Sep 17 00:00:00 2001 From: misvivek Date: Thu, 17 Oct 2024 04:41:37 +0000 Subject: [PATCH 01/10] Rebase master fork in my local --- rpc_util_test.go | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/rpc_util_test.go b/rpc_util_test.go index ca7990a005f1..7fa5ce50aa6b 100644 --- a/rpc_util_test.go +++ b/rpc_util_test.go @@ -21,12 +21,14 @@ package grpc import ( "bytes" "compress/gzip" + "errors" "io" "math" "reflect" "testing" "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding" protoenc "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/internal/testutils" "google.golang.org/grpc/internal/transport" @@ -290,3 +292,130 @@ func BenchmarkGZIPCompressor512KiB(b *testing.B) { func BenchmarkGZIPCompressor1MiB(b *testing.B) { bmCompressor(b, 1024*1024, NewGZIPCompressor()) } + +type mockCompressor struct { + DecompressedData []byte + ErrDecompress error + Size int + CustomReader io.Reader +} + +func (m *mockCompressor) Compress(w io.Writer) (io.WriteCloser, error) { + return nil, nil +} + +func (m *mockCompressor) Decompress(r io.Reader) (io.Reader, error) { + if m.ErrDecompress != nil { + return nil, m.ErrDecompress + } + if m.CustomReader != nil { + return m.CustomReader, nil + } + return bytes.NewReader(m.DecompressedData), nil +} + +func (m *mockCompressor) DecompressedSize(compressedBytes mem.BufferSlice) int { + return m.Size +} + +func (m *mockCompressor) Name() string { + return "mockCompressor" +} + +type ErrorReader struct{} + +func (e *ErrorReader) Read(p []byte) (n int, err error) { + return 0, errors.New("simulated io.Copy read error") +} + +func TestDecompress(t *testing.T) { + tests := []struct { + name string + compressor encoding.Compressor + input mem.BufferSlice + maxReceiveMessageSize int + want mem.BufferSlice + size int + error error + }{ + { + name: "Successful decompression", + compressor: &mockCompressor{ + DecompressedData: []byte("decompressed data"), + Size: 17, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 100, + want: func() mem.BufferSlice { + decompressed := []byte("decompressed data") + return mem.BufferSlice{mem.NewBuffer(&decompressed, nil)} + }(), + size: 1, + error: nil, + }, + { + name: "Error during decompression", + compressor: &mockCompressor{ + ErrDecompress: errors.New("decompression error"), + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 100, + want: nil, + size: 0, + error: errors.New("decompression error"), + }, + { + name: "Buffer overflow", + compressor: &mockCompressor{ + DecompressedData: []byte("overflow data"), + Size: 100, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 5, + want: nil, + size: 6, + error: errors.New("overflow: message larger than max size receivable by client (5 bytes)"), + }, + { + name: "MaxInt64 receive size with small data", + compressor: &mockCompressor{ + DecompressedData: []byte("small data"), + Size: 10, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: math.MaxInt64, + want: func() mem.BufferSlice { + smallDecompressed := []byte("small data, small data ") + return mem.BufferSlice{mem.NewBuffer(&smallDecompressed, nil)} + }(), + size: 1, + error: nil, + }, { + name: "Error during io.Copy", + compressor: &mockCompressor{ + CustomReader: &ErrorReader{}, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 100, + want: nil, + size: 0, + error: errors.New("simulated io.Copy read error"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + output, size, err := decompress(tt.compressor, tt.input, tt.maxReceiveMessageSize, nil) + // check both err and tt.error are either nil or non-nil, the condition will be false + if (err != nil) != (tt.error != nil) { + t.Errorf("unexpected error state: got err=%v, want err=%v", err, tt.error) + } + if size != tt.size { + t.Errorf("decompress() size = %d, want %d", size, tt.size) + } + if len(tt.want) != len(output) { + t.Errorf("decompress() output length = %d, want %d", output, tt.want) + } + }) + } +} From 4e19a071f492a4bee4250589be2b82457782ea5c Mon Sep 17 00:00:00 2001 From: misvivek Date: Thu, 17 Oct 2024 04:41:37 +0000 Subject: [PATCH 02/10] Rebase master fork in my local --- rpc_util_test.go | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/rpc_util_test.go b/rpc_util_test.go index 94f50bc24ade..ed01cf066f49 100644 --- a/rpc_util_test.go +++ b/rpc_util_test.go @@ -21,12 +21,14 @@ package grpc import ( "bytes" "compress/gzip" + "errors" "io" "math" "reflect" "testing" "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding" protoenc "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/internal/testutils" "google.golang.org/grpc/internal/transport" @@ -294,3 +296,130 @@ func BenchmarkGZIPCompressor512KiB(b *testing.B) { func BenchmarkGZIPCompressor1MiB(b *testing.B) { bmCompressor(b, 1024*1024, NewGZIPCompressor()) } + +type mockCompressor struct { + DecompressedData []byte + ErrDecompress error + Size int + CustomReader io.Reader +} + +func (m *mockCompressor) Compress(w io.Writer) (io.WriteCloser, error) { + return nil, nil +} + +func (m *mockCompressor) Decompress(r io.Reader) (io.Reader, error) { + if m.ErrDecompress != nil { + return nil, m.ErrDecompress + } + if m.CustomReader != nil { + return m.CustomReader, nil + } + return bytes.NewReader(m.DecompressedData), nil +} + +func (m *mockCompressor) DecompressedSize(compressedBytes mem.BufferSlice) int { + return m.Size +} + +func (m *mockCompressor) Name() string { + return "mockCompressor" +} + +type ErrorReader struct{} + +func (e *ErrorReader) Read(p []byte) (n int, err error) { + return 0, errors.New("simulated io.Copy read error") +} + +func TestDecompress(t *testing.T) { + tests := []struct { + name string + compressor encoding.Compressor + input mem.BufferSlice + maxReceiveMessageSize int + want mem.BufferSlice + size int + error error + }{ + { + name: "Successful decompression", + compressor: &mockCompressor{ + DecompressedData: []byte("decompressed data"), + Size: 17, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 100, + want: func() mem.BufferSlice { + decompressed := []byte("decompressed data") + return mem.BufferSlice{mem.NewBuffer(&decompressed, nil)} + }(), + size: 1, + error: nil, + }, + { + name: "Error during decompression", + compressor: &mockCompressor{ + ErrDecompress: errors.New("decompression error"), + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 100, + want: nil, + size: 0, + error: errors.New("decompression error"), + }, + { + name: "Buffer overflow", + compressor: &mockCompressor{ + DecompressedData: []byte("overflow data"), + Size: 100, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 5, + want: nil, + size: 6, + error: errors.New("overflow: message larger than max size receivable by client (5 bytes)"), + }, + { + name: "MaxInt64 receive size with small data", + compressor: &mockCompressor{ + DecompressedData: []byte("small data"), + Size: 10, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: math.MaxInt64, + want: func() mem.BufferSlice { + smallDecompressed := []byte("small data, small data ") + return mem.BufferSlice{mem.NewBuffer(&smallDecompressed, nil)} + }(), + size: 1, + error: nil, + }, { + name: "Error during io.Copy", + compressor: &mockCompressor{ + CustomReader: &ErrorReader{}, + }, + input: mem.BufferSlice{}, + maxReceiveMessageSize: 100, + want: nil, + size: 0, + error: errors.New("simulated io.Copy read error"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + output, size, err := decompress(tt.compressor, tt.input, tt.maxReceiveMessageSize, nil) + // check both err and tt.error are either nil or non-nil, the condition will be false + if (err != nil) != (tt.error != nil) { + t.Errorf("unexpected error state: got err=%v, want err=%v", err, tt.error) + } + if size != tt.size { + t.Errorf("decompress() size = %d, want %d", size, tt.size) + } + if len(tt.want) != len(output) { + t.Errorf("decompress() output length = %d, want %d", output, tt.want) + } + }) + } +} From a75629cde52946286df582d00dac248af772fc06 Mon Sep 17 00:00:00 2001 From: misvivek Date: Tue, 3 Dec 2024 07:51:46 +0000 Subject: [PATCH 03/10] Revert "Merge branch 'grpc:master' into master" This reverts commit e59ae3fc5f7fdae0ab1a4d39ccc324cfda8ee0ea, reversing changes made to 0cb56a2632c3f873104d878f9b8db1b64797ed30. --- test/clientconn_state_transition_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/clientconn_state_transition_test.go b/test/clientconn_state_transition_test.go index 547b5ffb9a24..a0a61099aee6 100644 --- a/test/clientconn_state_transition_test.go +++ b/test/clientconn_state_transition_test.go @@ -39,7 +39,6 @@ import ( "google.golang.org/grpc/internal/stubserver" "google.golang.org/grpc/internal/testutils" testgrpc "google.golang.org/grpc/interop/grpc_testing" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver/manual" ) @@ -679,7 +678,7 @@ func (s) TestChannelStateTransitionWithRPC(t *testing.T) { // Make an RPC call to transition the channel to CONNECTING. go func() { - _, err := testgrpc.NewTestServiceClient(cc).EmptyCall(ctx, &testpb.Empty{}) + _, err := testgrpc.NewTestServiceClient(cc).EmptyCall(ctx, &testgrpc.Empty{}) if err == nil { t.Errorf("Expected RPC to fail, but it succeeded") } From 6e6b498969e4f350e15524a6b14f514724c86fb0 Mon Sep 17 00:00:00 2001 From: misvivek Date: Tue, 3 Dec 2024 08:15:35 +0000 Subject: [PATCH 04/10] pr ref --- internal/transport/handler_server_test.go | 1 + internal/transport/http2_server.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/internal/transport/handler_server_test.go b/internal/transport/handler_server_test.go index ca1a38de0f86..94f4e748ca59 100644 --- a/internal/transport/handler_server_test.go +++ b/internal/transport/handler_server_test.go @@ -348,6 +348,7 @@ func handleStreamCloseBodyTest(t *testing.T, statusCode codes.Code, msg string) st.ht.HandleStreams( context.Background(), func(s *ServerStream) { go handleStream(s) }, ) + wantHeader := http.Header{ "Date": nil, "Content-Type": {"application/grpc"}, diff --git a/internal/transport/http2_server.go b/internal/transport/http2_server.go index 0055fddd7ecf..4007dce97445 100644 --- a/internal/transport/http2_server.go +++ b/internal/transport/http2_server.go @@ -1100,6 +1100,9 @@ func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { } // Send a RST_STREAM after the trailers if the client has not already half-closed. rst := s.getState() == streamActive + if rst { + signalDeadlineExceeded() + } t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true) for _, sh := range t.stats { // Note: The trailer fields are compressed with hpack after this call returns. @@ -1111,6 +1114,8 @@ func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { return nil } +var signalDeadlineExceeded = func() {} + // Write converts the data into HTTP2 data frame and sends it out. Non-nil error // is returns if it fails (e.g., framing error, transport error). func (t *http2Server) write(s *ServerStream, hdr []byte, data mem.BufferSlice, _ *WriteOptions) error { From fb004c21816fb21d887ca78acaa64135263c85da Mon Sep 17 00:00:00 2001 From: misvivek Date: Wed, 4 Dec 2024 07:07:34 +0000 Subject: [PATCH 05/10] revert the file rpc_util_test clientcon_state__trasition --- rpc_util_test.go | 129 ----------------------- test/clientconn_state_transition_test.go | 3 +- 2 files changed, 2 insertions(+), 130 deletions(-) diff --git a/rpc_util_test.go b/rpc_util_test.go index ed01cf066f49..94f50bc24ade 100644 --- a/rpc_util_test.go +++ b/rpc_util_test.go @@ -21,14 +21,12 @@ package grpc import ( "bytes" "compress/gzip" - "errors" "io" "math" "reflect" "testing" "google.golang.org/grpc/codes" - "google.golang.org/grpc/encoding" protoenc "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/internal/testutils" "google.golang.org/grpc/internal/transport" @@ -296,130 +294,3 @@ func BenchmarkGZIPCompressor512KiB(b *testing.B) { func BenchmarkGZIPCompressor1MiB(b *testing.B) { bmCompressor(b, 1024*1024, NewGZIPCompressor()) } - -type mockCompressor struct { - DecompressedData []byte - ErrDecompress error - Size int - CustomReader io.Reader -} - -func (m *mockCompressor) Compress(w io.Writer) (io.WriteCloser, error) { - return nil, nil -} - -func (m *mockCompressor) Decompress(r io.Reader) (io.Reader, error) { - if m.ErrDecompress != nil { - return nil, m.ErrDecompress - } - if m.CustomReader != nil { - return m.CustomReader, nil - } - return bytes.NewReader(m.DecompressedData), nil -} - -func (m *mockCompressor) DecompressedSize(compressedBytes mem.BufferSlice) int { - return m.Size -} - -func (m *mockCompressor) Name() string { - return "mockCompressor" -} - -type ErrorReader struct{} - -func (e *ErrorReader) Read(p []byte) (n int, err error) { - return 0, errors.New("simulated io.Copy read error") -} - -func TestDecompress(t *testing.T) { - tests := []struct { - name string - compressor encoding.Compressor - input mem.BufferSlice - maxReceiveMessageSize int - want mem.BufferSlice - size int - error error - }{ - { - name: "Successful decompression", - compressor: &mockCompressor{ - DecompressedData: []byte("decompressed data"), - Size: 17, - }, - input: mem.BufferSlice{}, - maxReceiveMessageSize: 100, - want: func() mem.BufferSlice { - decompressed := []byte("decompressed data") - return mem.BufferSlice{mem.NewBuffer(&decompressed, nil)} - }(), - size: 1, - error: nil, - }, - { - name: "Error during decompression", - compressor: &mockCompressor{ - ErrDecompress: errors.New("decompression error"), - }, - input: mem.BufferSlice{}, - maxReceiveMessageSize: 100, - want: nil, - size: 0, - error: errors.New("decompression error"), - }, - { - name: "Buffer overflow", - compressor: &mockCompressor{ - DecompressedData: []byte("overflow data"), - Size: 100, - }, - input: mem.BufferSlice{}, - maxReceiveMessageSize: 5, - want: nil, - size: 6, - error: errors.New("overflow: message larger than max size receivable by client (5 bytes)"), - }, - { - name: "MaxInt64 receive size with small data", - compressor: &mockCompressor{ - DecompressedData: []byte("small data"), - Size: 10, - }, - input: mem.BufferSlice{}, - maxReceiveMessageSize: math.MaxInt64, - want: func() mem.BufferSlice { - smallDecompressed := []byte("small data, small data ") - return mem.BufferSlice{mem.NewBuffer(&smallDecompressed, nil)} - }(), - size: 1, - error: nil, - }, { - name: "Error during io.Copy", - compressor: &mockCompressor{ - CustomReader: &ErrorReader{}, - }, - input: mem.BufferSlice{}, - maxReceiveMessageSize: 100, - want: nil, - size: 0, - error: errors.New("simulated io.Copy read error"), - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - output, size, err := decompress(tt.compressor, tt.input, tt.maxReceiveMessageSize, nil) - // check both err and tt.error are either nil or non-nil, the condition will be false - if (err != nil) != (tt.error != nil) { - t.Errorf("unexpected error state: got err=%v, want err=%v", err, tt.error) - } - if size != tt.size { - t.Errorf("decompress() size = %d, want %d", size, tt.size) - } - if len(tt.want) != len(output) { - t.Errorf("decompress() output length = %d, want %d", output, tt.want) - } - }) - } -} diff --git a/test/clientconn_state_transition_test.go b/test/clientconn_state_transition_test.go index a0a61099aee6..547b5ffb9a24 100644 --- a/test/clientconn_state_transition_test.go +++ b/test/clientconn_state_transition_test.go @@ -39,6 +39,7 @@ import ( "google.golang.org/grpc/internal/stubserver" "google.golang.org/grpc/internal/testutils" testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver/manual" ) @@ -678,7 +679,7 @@ func (s) TestChannelStateTransitionWithRPC(t *testing.T) { // Make an RPC call to transition the channel to CONNECTING. go func() { - _, err := testgrpc.NewTestServiceClient(cc).EmptyCall(ctx, &testgrpc.Empty{}) + _, err := testgrpc.NewTestServiceClient(cc).EmptyCall(ctx, &testpb.Empty{}) if err == nil { t.Errorf("Expected RPC to fail, but it succeeded") } From 0cf35849d5431b5916c08720f59a712a24459195 Mon Sep 17 00:00:00 2001 From: misvivek Date: Wed, 4 Dec 2024 09:35:04 +0000 Subject: [PATCH 06/10] added the override function in hadle server --- internal/transport/handler_server_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/transport/handler_server_test.go b/internal/transport/handler_server_test.go index 94f4e748ca59..c17aad611198 100644 --- a/internal/transport/handler_server_test.go +++ b/internal/transport/handler_server_test.go @@ -394,7 +394,18 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { return } s.WriteStatus(status.New(codes.DeadlineExceeded, "too slow")) + // rst flag setting to verify the noop function: signalDeadlineExceeded + ch := make(chan struct{}, 1) + origSignalDeadlineExceeded := signalDeadlineExceeded + signalDeadlineExceeded = func() { + ch <- struct{}{} + } + defer func() { + signalDeadlineExceeded = origSignalDeadlineExceeded + }() + } + ht.HandleStreams( context.Background(), func(s *ServerStream) { go runStream(s) }, ) From dea8408cd265d1302572465211293f8f727ab9ef Mon Sep 17 00:00:00 2001 From: misvivek Date: Wed, 4 Dec 2024 11:45:11 +0000 Subject: [PATCH 07/10] added select statement for case --- internal/transport/handler_server_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/transport/handler_server_test.go b/internal/transport/handler_server_test.go index c17aad611198..8ac3734fb200 100644 --- a/internal/transport/handler_server_test.go +++ b/internal/transport/handler_server_test.go @@ -393,7 +393,6 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { t.Errorf("ctx.Err = %v; want %v", err, context.DeadlineExceeded) return } - s.WriteStatus(status.New(codes.DeadlineExceeded, "too slow")) // rst flag setting to verify the noop function: signalDeadlineExceeded ch := make(chan struct{}, 1) origSignalDeadlineExceeded := signalDeadlineExceeded @@ -403,9 +402,14 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { defer func() { signalDeadlineExceeded = origSignalDeadlineExceeded }() - + s.WriteStatus(status.New(codes.DeadlineExceeded, "too slow")) + select { + case <-s.ctx.Done(): + case <-time.After(5 * time.Second): + t.Errorf("timeout waiting for ctx.Done") + return + } } - ht.HandleStreams( context.Background(), func(s *ServerStream) { go runStream(s) }, ) From 86a4997297b55d76c0bcf8f381e46e7c4faed47b Mon Sep 17 00:00:00 2001 From: misvivek Date: Thu, 5 Dec 2024 13:25:28 +0000 Subject: [PATCH 08/10] verify the data in the dat available --- internal/transport/handler_server_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/transport/handler_server_test.go b/internal/transport/handler_server_test.go index 8ac3734fb200..5123c4238e10 100644 --- a/internal/transport/handler_server_test.go +++ b/internal/transport/handler_server_test.go @@ -404,6 +404,7 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { }() s.WriteStatus(status.New(codes.DeadlineExceeded, "too slow")) select { + case <-ch: // Signal received, continue with the test case <-s.ctx.Done(): case <-time.After(5 * time.Second): t.Errorf("timeout waiting for ctx.Done") From 5aada3616e08379d6ab05779d26c23df6016fa0c Mon Sep 17 00:00:00 2001 From: misvivek Date: Mon, 9 Dec 2024 10:27:26 +0000 Subject: [PATCH 09/10] change done on checkHeaderandtrailer --- internal/transport/handler_server_test.go | 34 ++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/internal/transport/handler_server_test.go b/internal/transport/handler_server_test.go index 5123c4238e10..4e2860ebd928 100644 --- a/internal/transport/handler_server_test.go +++ b/internal/transport/handler_server_test.go @@ -380,6 +380,15 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { if err != nil { t.Fatal(err) } + // rst flag setting to verify the noop function: signalDeadlineExceeded + ch := make(chan struct{}, 1) + origSignalDeadlineExceeded := signalDeadlineExceeded + signalDeadlineExceeded = func() { + ch <- struct{}{} + } + defer func() { + signalDeadlineExceeded = origSignalDeadlineExceeded + }() runStream := func(s *ServerStream) { defer bodyw.Close() select { @@ -393,23 +402,9 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { t.Errorf("ctx.Err = %v; want %v", err, context.DeadlineExceeded) return } - // rst flag setting to verify the noop function: signalDeadlineExceeded - ch := make(chan struct{}, 1) - origSignalDeadlineExceeded := signalDeadlineExceeded - signalDeadlineExceeded = func() { - ch <- struct{}{} - } - defer func() { - signalDeadlineExceeded = origSignalDeadlineExceeded - }() + s.WriteStatus(status.New(codes.DeadlineExceeded, "too slow")) - select { - case <-ch: // Signal received, continue with the test - case <-s.ctx.Done(): - case <-time.After(5 * time.Second): - t.Errorf("timeout waiting for ctx.Done") - return - } + } ht.HandleStreams( context.Background(), func(s *ServerStream) { go runStream(s) }, @@ -424,6 +419,13 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { "Grpc-Message": {encodeGrpcMessage("too slow")}, } checkHeaderAndTrailer(t, rw, wantHeader, wantTrailer) + select { + case <-ch: // Signal received, continue with the test + case <-time.After(5 * time.Second): + t.Errorf("timeout waiting for ctx.Done") + return + } + } // TestHandlerTransport_HandleStreams_MultiWriteStatus ensures that From 961f5e5f1d28e5d6ba3c9958aef7b60efbe12298 Mon Sep 17 00:00:00 2001 From: misvivek Date: Wed, 11 Dec 2024 06:35:13 +0000 Subject: [PATCH 10/10] add the comment --- internal/transport/handler_server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/transport/handler_server_test.go b/internal/transport/handler_server_test.go index 4e2860ebd928..f438b9941993 100644 --- a/internal/transport/handler_server_test.go +++ b/internal/transport/handler_server_test.go @@ -422,7 +422,7 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { select { case <-ch: // Signal received, continue with the test case <-time.After(5 * time.Second): - t.Errorf("timeout waiting for ctx.Done") + t.Errorf("timeout waiting for signalDeadlineExceeded") return }