Skip to content

Commit 13cf0ba

Browse files
committed
Test trailers bug when there are data frames in queue
1 parent 63b17e4 commit 13cf0ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/handlers/resp_h.erl

+2-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ do(<<"stream_trailers">>, Req0, Opts) ->
361361
Req = cowboy_req:stream_reply(200, #{
362362
<<"trailer">> => <<"grpc-status">>
363363
}, Req0),
364-
cowboy_req:stream_body(<<0:800000>>, nofin, Req),
364+
%% The size should be larger than StreamSize and ConnSize
365+
cowboy_req:stream_body(<<0:80000000>>, nofin, Req),
365366
cowboy_req:stream_trailers(#{
366367
<<"grpc-status">> => <<"0">>
367368
}, Req),

test/req_SUITE.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ stream_trailers(Config) ->
10681068

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

0 commit comments

Comments
 (0)