comparison proxy_unfinished.t @ 1043:b82f54728e14

Tests: fixed test failure in proxy_unfinished.t with big buffers. Skip the "no proxy temp" test if the response is finished, namely, if a calculated content length of the chunked body matches the expected value. Although a finished response is sort of expected, it can be further split in chunks with a recent change f379b32e4733 (1.11.2) in sub filter module, which broke a pre-existing check for the finished response.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 29 Sep 2016 12:52:12 +0300
parents 196d33c2bb45
children 8659123d2d37
comparison
equal deleted inserted replaced
1042:9339673bb454 1043:b82f54728e14
138 138
139 # if disk buffering fails for some reason, there should be 139 # if disk buffering fails for some reason, there should be
140 # no final chunk 140 # no final chunk
141 141
142 chmod(0000, $t->testdir() . '/proxy_temp'); 142 chmod(0000, $t->testdir() . '/proxy_temp');
143 like(http_get_11('/proxy/big.html', sleep => 0.5), 143
144 qr/X(?!.*\x0d\x0a?0\x0d\x0a?)|finished/s, 'no proxy temp'); 144 my $r = http_get_11('/proxy/big.html', sleep => 0.5);
145
146 SKIP: {
147 skip 'finished', 1 if length(Test::Nginx::http_content($r)) == 1024 * 1024 + 8;
148
149 like($r, qr/X(?!.*\x0d\x0a?0\x0d\x0a?)/s, 'no proxy temp');
150
151 }
145 152
146 chmod(0700, $t->testdir() . '/proxy_temp'); 153 chmod(0700, $t->testdir() . '/proxy_temp');
147 154
148 ############################################################################### 155 ###############################################################################
149 156