From 8ae1311a05b59d8c1f9d2d9dae5f63dce28bc58e Mon Sep 17 00:00:00 2001
From: haohongfan <haohongfan@ling.ai>
Date: Sat, 5 Sep 2020 22:32:53 +0800
Subject: [PATCH] feat: rest GetBigPkg

---
 remoting/getty/getty_client_test.go | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go
index f9e94809a..41ca3108a 100644
--- a/remoting/getty/getty_client_test.go
+++ b/remoting/getty/getty_client_test.go
@@ -18,6 +18,7 @@
 package getty
 
 import (
+	"bytes"
 	"context"
 	"reflect"
 	"sync"
@@ -41,11 +42,6 @@ import (
 	"github.com/apache/dubbo-go/remoting"
 )
 
-const (
-	DubboCodecForTestUserID   = "DubboCodecForTestUserID"
-	DubboCodecForTestUserName = "DubboCodecForTestUserName"
-)
-
 func TestRunSuite(t *testing.T) {
 	svr, url := InitTest(t)
 	client := getClient(url)
@@ -126,8 +122,8 @@ func testGetBigPkg(t *testing.T, c *Client) {
 	remoting.AddPendingResponse(pendingResponse)
 	err := c.Request(request, 8*time.Second, pendingResponse)
 	assert.NoError(t, err)
-	assert.Equal(t, DubboCodecForTestUserID, user.Id)
-	assert.Equal(t, DubboCodecForTestUserName, user.Name)
+	assert.NotEqual(t, "", user.Id)
+	assert.NotEqual(t, "", user.Name)
 }
 
 func testGetUser(t *testing.T, c *Client) {
@@ -438,8 +434,13 @@ type (
 
 // size:4801228
 func (u *UserProvider) GetBigPkg(ctx context.Context, req []interface{}, rsp *User) error {
-	rsp.Id = DubboCodecForTestUserID
-	rsp.Name = DubboCodecForTestUserName
+	argBuf := new(bytes.Buffer)
+	for i := 0; i < 400; i++ {
+		argBuf.WriteString("鍑婚紦鍏堕晽锛岃笂璺冪敤鍏点€傚湡鍥藉煄婕曪紝鎴戠嫭鍗楄銆備粠瀛欏瓙浠诧紝骞抽檲涓庡畫銆備笉鎴戜互褰掞紝蹇у績鏈夊俊銆傜埌灞呯埌澶勶紵鐖颁抚鍏堕┈锛熶簬浠ユ眰涔嬶紵浜庢灄涔嬩笅銆傛鐢熷闃旓紝涓庡瓙鎴愯銆傛墽瀛愪箣鎵嬶紝涓庡瓙鍋曡€併€備簬鍡熼様鍏紝涓嶆垜娲诲叜銆備簬鍡熸吹鍏紝涓嶆垜淇″叜銆�")
+		argBuf.WriteString("鍑婚紦鍏堕晽锛岃笂璺冪敤鍏点€傚湡鍥藉煄婕曪紝鎴戠嫭鍗楄銆備粠瀛欏瓙浠诧紝骞抽檲涓庡畫銆備笉鎴戜互褰掞紝蹇у績鏈夊俊銆傜埌灞呯埌澶勶紵鐖颁抚鍏堕┈锛熶簬浠ユ眰涔嬶紵浜庢灄涔嬩笅銆傛鐢熷闃旓紝涓庡瓙鎴愯銆傛墽瀛愪箣鎵嬶紝涓庡瓙鍋曡€併€備簬鍡熼様鍏紝涓嶆垜娲诲叜銆備簬鍡熸吹鍏紝涓嶆垜淇″叜銆�")
+	}
+	rsp.Id = argBuf.String()
+	rsp.Name = argBuf.String()
 	return nil
 }
 
-- 
GitLab