comparison scgi_gzip.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
52 } 52 }
53 53
54 EOF 54 EOF
55 55
56 $t->run_daemon(\&scgi_daemon); 56 $t->run_daemon(\&scgi_daemon);
57 $t->run(); 57 $t->run()->waitforsocket('127.0.0.1:' . port(1));
58 58
59 ############################################################################### 59 ###############################################################################
60 60
61 like(http_gzip_request('/'), qr/Content-Encoding: gzip/, 'scgi request'); 61 like(http_gzip_request('/'), qr/Content-Encoding: gzip/, 'scgi request');
62 62
72 or die "Can't create listening socket: $!\n"; 72 or die "Can't create listening socket: $!\n";
73 73
74 my $scgi = SCGI->new($server, blocking => 1); 74 my $scgi = SCGI->new($server, blocking => 1);
75 75
76 while (my $request = $scgi->accept()) { 76 while (my $request = $scgi->accept()) {
77 $request->read_env(); 77 eval { $request->read_env(); };
78 next if $@;
78 79
79 $request->connection()->print(<<EOF); 80 $request->connection()->print(<<EOF);
80 Content-Type: text/html 81 Content-Type: text/html
81 82
82 SEE-THIS-1234567890-1234567890 83 SEE-THIS-1234567890-1234567890