Browse Source

Test trailers bug when there are data frames in queue

Tony Han 5 years ago
parent
commit
43f1754f33
2 changed files with 3 additions and 2 deletions
  1. 2 1
      test/handlers/resp_h.erl
  2. 1 1
      test/req_SUITE.erl

+ 2 - 1
test/handlers/resp_h.erl

@@ -361,7 +361,8 @@ do(<<"stream_trailers">>, Req0, Opts) ->
 			Req = cowboy_req:stream_reply(200, #{
 			Req = cowboy_req:stream_reply(200, #{
 				<<"trailer">> => <<"grpc-status">>
 				<<"trailer">> => <<"grpc-status">>
 			}, Req0),
 			}, Req0),
-			cowboy_req:stream_body(<<0:800000>>, nofin, Req),
+			%% The size should be larger than StreamSize and ConnSize
+			cowboy_req:stream_body(<<0:80000000>>, nofin, Req),
 			cowboy_req:stream_trailers(#{
 			cowboy_req:stream_trailers(#{
 				<<"grpc-status">> => <<"0">>
 				<<"grpc-status">> => <<"0">>
 			}, Req),
 			}, Req),

+ 1 - 1
test/req_SUITE.erl

@@ -1068,7 +1068,7 @@ stream_trailers(Config) ->
 
 
 stream_trailers_large(Config) ->
 stream_trailers_large(Config) ->
 	doc("Stream large body followed by trailer headers."),
 	doc("Stream large body followed by trailer headers."),
-	{200, RespHeaders, <<0:800000>>, [
+	{200, RespHeaders, <<0:80000000>>, [
 		{<<"grpc-status">>, <<"0">>}
 		{<<"grpc-status">>, <<"0">>}
 	]} = do_trailers("/resp/stream_trailers/large", Config),
 	]} = do_trailers("/resp/stream_trailers/large", Config),
 	{_, <<"grpc-status">>} = lists:keyfind(<<"trailer">>, 1, RespHeaders),
 	{_, <<"grpc-status">>} = lists:keyfind(<<"trailer">>, 1, RespHeaders),