Mercurial > hg > nginx-tests
comparison proxy.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 | c1269426585d |
comparison
equal
deleted
inserted
replaced
294:71e275487aeb | 295:6fe0459b6668 |
---|---|
47 } | 47 } |
48 | 48 |
49 EOF | 49 EOF |
50 | 50 |
51 $t->run_daemon(\&http_daemon); | 51 $t->run_daemon(\&http_daemon); |
52 $t->run(); | 52 $t->run()->waitforsocket('127.0.0.1:8081'); |
53 | 53 |
54 ############################################################################### | 54 ############################################################################### |
55 | 55 |
56 like(http_get('/'), qr/SEE-THIS/, 'proxy request'); | 56 like(http_get('/'), qr/SEE-THIS/, 'proxy request'); |
57 like(http_get('/multi'), qr/AND-THIS/, 'proxy request with multiple packets'); | 57 like(http_get('/multi'), qr/AND-THIS/, 'proxy request with multiple packets'); |
66 LocalHost => '127.0.0.1:8081', | 66 LocalHost => '127.0.0.1:8081', |
67 Listen => 5, | 67 Listen => 5, |
68 Reuse => 1 | 68 Reuse => 1 |
69 ) | 69 ) |
70 or die "Can't create listening socket: $!\n"; | 70 or die "Can't create listening socket: $!\n"; |
71 | |
72 local $SIG{PIPE} = 'IGNORE'; | |
71 | 73 |
72 while (my $client = $server->accept()) { | 74 while (my $client = $server->accept()) { |
73 $client->autoflush(1); | 75 $client->autoflush(1); |
74 | 76 |
75 my $headers = ''; | 77 my $headers = ''; |