From 3df2868eb50832316bd04695b679a97aaa44e718 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 17 Apr 2025 08:19:12 -0400 Subject: [PATCH] MT#55283 react better on receive timeouts Change-Id: I13e7ba0c5ea1291b7f477ee45e8d3b3b01a020f5 --- perl/NGCP/Rtpengine/AutoTest.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perl/NGCP/Rtpengine/AutoTest.pm b/perl/NGCP/Rtpengine/AutoTest.pm index add50d0ea..a2483fd42 100644 --- a/perl/NGCP/Rtpengine/AutoTest.pm +++ b/perl/NGCP/Rtpengine/AutoTest.pm @@ -83,6 +83,10 @@ sub autotest_init { my $r = $c->req({command => 'ping'}); ok $r->{result} eq 'pong', 'ping works, daemon operational'; + $SIG{__DIE__} = sub { + terminate(@_); + }; + return 1; } @@ -211,7 +215,7 @@ sub rtp { sub rcv { my ($sock, $port, $match, $cb, $cb_arg) = @_; my $p = ''; - local $SIG{ALRM} = sub { exit(-10) }; + local $SIG{ALRM} = sub { die("recv timed out"); }; alarm(1); my $addr = $sock->recv($p, 65535, 0) or die; alarm(0);