comparison lib/Test/Nginx.pm @ 163:450206ed1fd2

Tests: move logging out of alarm. Logging large amounts of data may be terminated by alarm() which isn't really good (and likely to corrupt TAP output). Problem seen on limit_req.t test with logging enabled.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 01 Aug 2011 21:23:49 +0400
parents 33f6ec774efa
children f602276b9bb9
comparison
equal deleted inserted replaced
162:465a711ffa19 163:450206ed1fd2
364 $s->print($request); 364 $s->print($request);
365 local $/; 365 local $/;
366 select undef, undef, undef, $extra{sleep} if $extra{sleep}; 366 select undef, undef, undef, $extra{sleep} if $extra{sleep};
367 return '' if $extra{aborted}; 367 return '' if $extra{aborted};
368 $reply = $s->getline(); 368 $reply = $s->getline();
369 log_in($reply);
370 alarm(0); 369 alarm(0);
371 }; 370 };
372 alarm(0); 371 alarm(0);
373 if ($@) { 372 if ($@) {
374 log_in("died: $@"); 373 log_in("died: $@");
375 return undef; 374 return undef;
375 } else {
376 log_in($reply);
376 } 377 }
377 return $reply; 378 return $reply;
378 } 379 }
379 380
380 ############################################################################### 381 ###############################################################################