comparison proxy_cache.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 44c42894fdfd
comparison
equal deleted inserted replaced
294:71e275487aeb 295:6fe0459b6668
78 EOF 78 EOF
79 79
80 $t->write_file('t.html', 'SEE-THIS'); 80 $t->write_file('t.html', 'SEE-THIS');
81 $t->write_file('t2.html', 'SEE-THIS'); 81 $t->write_file('t2.html', 'SEE-THIS');
82 $t->write_file('empty.html', ''); 82 $t->write_file('empty.html', '');
83
83 $t->run_daemon(\&http_fake_daemon); 84 $t->run_daemon(\&http_fake_daemon);
84 $t->run(); 85 $t->run()->waitforsocket('127.0.0.1:8081');
85 86
86 ############################################################################### 87 ###############################################################################
87 88
88 like(http_get('/t.html'), qr/SEE-THIS/, 'proxy request'); 89 like(http_get('/t.html'), qr/SEE-THIS/, 'proxy request');
89 90
137 Listen => 5, 138 Listen => 5,
138 Reuse => 1 139 Reuse => 1
139 ) 140 )
140 or die "Can't create listening socket: $!\n"; 141 or die "Can't create listening socket: $!\n";
141 142
143 local $SIG{PIPE} = 'IGNORE';
144
142 my $num = 0; 145 my $num = 0;
143 146
144 while (my $client = $server->accept()) { 147 while (my $client = $server->accept()) {
145 $client->autoflush(1); 148 $client->autoflush(1);
146 149