# HG changeset patch # User Sergey Kandaurov # Date 1624268678 -10800 # Node ID 99a9b8b50f21c29788c3cac85f54b210ac24dfee # Parent 4b808861a318c410934e74c0c27b5f60fd13c283 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. diff --git a/grpc.t b/grpc.t --- a/grpc.t +++ b/grpc.t @@ -719,17 +719,11 @@ sub grpc { { name => 'te', value => 'trailers', mode => 2 }]}); if (!$extra{reuse}) { - eval { - local $SIG{ALRM} = sub { die "timeout\n" }; - alarm(5); - - $client = $server->accept() or return; + if (IO::Select->new($server)->can_read(5)) { + $client = $server->accept(); - alarm(0); - }; - alarm(0); - if ($@) { - log_in("died: $@"); + } else { + log_in("timeout"); # connection could be unexpectedly reused goto reused if $client; return undef;