Mercurial > hg > nginx-tests
comparison proxy_chunked.t @ 295:6fe0459b6668
Tests: eliminate startup races in proxy and fastcgi tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 08 Jun 2013 07:02:11 +0400 |
parents | 6a0d934950bc |
children | f02dac68d584 |
comparison
equal
deleted
inserted
replaced
294:71e275487aeb | 295:6fe0459b6668 |
---|---|
64 | 64 |
65 $t->write_file('inmemory.html', | 65 $t->write_file('inmemory.html', |
66 '<!--#include virtual="/" set="one" --><!--#echo var="one" -->'); | 66 '<!--#include virtual="/" set="one" --><!--#echo var="one" -->'); |
67 | 67 |
68 $t->run_daemon(\&http_chunked_daemon); | 68 $t->run_daemon(\&http_chunked_daemon); |
69 $t->run(); | 69 $t->run()->waitforsocket('127.0.0.1:8081'); |
70 | 70 |
71 ############################################################################### | 71 ############################################################################### |
72 | 72 |
73 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked'); | 73 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked'); |
74 like(http_get('/nobuffering'), qr/\x0d\x0aSEE-THIS$/s, 'chunked nobuffering'); | 74 like(http_get('/nobuffering'), qr/\x0d\x0aSEE-THIS$/s, 'chunked nobuffering'); |
82 LocalAddr => '127.0.0.1:8081', | 82 LocalAddr => '127.0.0.1:8081', |
83 Listen => 5, | 83 Listen => 5, |
84 Reuse => 1 | 84 Reuse => 1 |
85 ) | 85 ) |
86 or die "Can't create listening socket: $!\n"; | 86 or die "Can't create listening socket: $!\n"; |
87 | |
88 local $SIG{PIPE} = 'IGNORE'; | |
87 | 89 |
88 while (my $client = $server->accept()) { | 90 while (my $client = $server->accept()) { |
89 $client->autoflush(1); | 91 $client->autoflush(1); |
90 | 92 |
91 while (<$client>) { | 93 while (<$client>) { |