comparison grpc_request_buffering.t @ 1356:ca6fe31f74c4

Tests: TODO grpc request body "first body bytes" test on FreeBSD. The test catches improper tcp_nopush usage, fixed in 8eab05b83dde.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 09 Jul 2018 09:17:23 +0300
parents 65730ba03b42
children 97c8280de681
comparison
equal deleted inserted replaced
1355:afe541649054 1356:ca6fe31f74c4
86 86
87 $frames = $f->{http_end}(); 87 $frames = $f->{http_end}();
88 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 88 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
89 is($frame->{headers}{'x-body'}, 'Hello', 'request body in memory'); 89 is($frame->{headers}{'x-body'}, 'Hello', 'request body in memory');
90 90
91 # tcp_nopush usage on peer connections
92 # reopen window for request body after initial window was exhausted
93
94 TODO: {
95 local $TODO = 'not yet' if $t->read_file('nginx.conf') =~ /sendfile on/
96 and !$t->has_version('1.15.1') and $^O eq 'freebsd';
97
98 $frames = $f->{http_start}('/proxy');
99 is(eval(join '+', map { $_->{length} } grep { $_->{type} eq "DATA" } @$frames),
100 65535, 'preserve_output - first body bytes');
101
102 }
103
91 # expect body cleanup is disabled with preserve_output (ticket #1565). 104 # expect body cleanup is disabled with preserve_output (ticket #1565).
92 # after request body first bytes were proxied on behalf of initial window size, 105 # after request body first bytes were proxied on behalf of initial window size,
93 # send response header from upstream, this leads to body cleanup code path 106 # send response header from upstream, this leads to body cleanup code path
94
95 $frames = $f->{http_start}('/proxy');
96 is(eval(join '+', map { $_->{length} } grep { $_->{type} eq "DATA" } @$frames),
97 65535, 'preserve_output - first body bytes');
98 107
99 TODO: { 108 TODO: {
100 local $TODO = 'not yet' unless $t->has_version('1.15.1'); 109 local $TODO = 'not yet' unless $t->has_version('1.15.1');
101 110
102 $frames = $f->{http_end}(); 111 $frames = $f->{http_end}();