comparison grpc.t @ 1705:99a9b8b50f21

Tests: fixed grpc.t TODO hang on win32. The eval + alarm model was replaced with non-blocking I/O for the same reasons as in d0025a0dead7.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 21 Jun 2021 12:44:38 +0300
parents c903c0a3f302
children e3dd111410fe
comparison
equal deleted inserted replaced
1704:4b808861a318 1705:99a9b8b50f21
717 { name => ':authority', value => 'localhost' }, 717 { name => ':authority', value => 'localhost' },
718 { name => 'content-type', value => 'application/grpc' }, 718 { name => 'content-type', value => 'application/grpc' },
719 { name => 'te', value => 'trailers', mode => 2 }]}); 719 { name => 'te', value => 'trailers', mode => 2 }]});
720 720
721 if (!$extra{reuse}) { 721 if (!$extra{reuse}) {
722 eval { 722 if (IO::Select->new($server)->can_read(5)) {
723 local $SIG{ALRM} = sub { die "timeout\n" }; 723 $client = $server->accept();
724 alarm(5); 724
725 725 } else {
726 $client = $server->accept() or return; 726 log_in("timeout");
727
728 alarm(0);
729 };
730 alarm(0);
731 if ($@) {
732 log_in("died: $@");
733 # connection could be unexpectedly reused 727 # connection could be unexpectedly reused
734 goto reused if $client; 728 goto reused if $client;
735 return undef; 729 return undef;
736 } 730 }
737 731