comparison scgi.t @ 960:d4a0232425ee

Tests: fixed race in SCGI tests.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 24 Jun 2016 16:30:08 +0300
parents e9064d691790
children 882267679006
comparison
equal deleted inserted replaced
959:508ee7ea9706 960:d4a0232425ee
62 } 62 }
63 63
64 EOF 64 EOF
65 65
66 $t->run_daemon(\&scgi_daemon); 66 $t->run_daemon(\&scgi_daemon);
67 $t->run(); 67 $t->run()->waitforsocket('127.0.0.1:' . port(1));
68 68
69 ############################################################################### 69 ###############################################################################
70 70
71 like(http_get('/'), qr/SEE-THIS/, 'scgi request'); 71 like(http_get('/'), qr/SEE-THIS/, 'scgi request');
72 like(http_get('/redir'), qr/ 302 /, 'scgi redirect'); 72 like(http_get('/redir'), qr/ 302 /, 'scgi redirect');
124 124
125 my $scgi = SCGI->new($server, blocking => 1); 125 my $scgi = SCGI->new($server, blocking => 1);
126 my $count = 0; 126 my $count = 0;
127 127
128 while (my $request = $scgi->accept()) { 128 while (my $request = $scgi->accept()) {
129 eval { $request->read_env(); };
130 next if $@;
131
129 $count++; 132 $count++;
130 $request->read_env();
131 133
132 $request->connection()->print(<<EOF); 134 $request->connection()->print(<<EOF);
133 Location: http://localhost/redirect 135 Location: http://localhost/redirect
134 Content-Type: text/html 136 Content-Type: text/html
135 137