Skip to content

Commit

Permalink
Netbench dies with failure if any process failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluhm committed Jan 24, 2024
1 parent f649d35 commit 674769a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions netbench.pl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@
print_status_tcp() if $testmode{tcp};
print_status_udp() if $testmode{udp};

my @failed = map { $_->{status} ? $_->{name} : () }
(@clients, @relays, @servers);
die "Process '@failed' failed" if @failed;

exit;

sub start_server_tcp {
Expand Down Expand Up @@ -365,9 +369,12 @@ sub read_output {
}
}
unless ($!{EWOULDBLOCK}) {
close($proc->{fh}) or warn $! ?
"Close pipe from proc $proc->{name} '@{$proc->{cmd}}' failed: $!" :
"Proc $proc->{name} '@{$proc->{cmd}}' failed: $?";
unless (close($proc->{fh})) {
die "Close pipe from proc $proc->{name} '@{$proc->{cmd}}' ".
"failed: $!" if $!;
warn "Proc $proc->{name} '@{$proc->{cmd}}' failed: $?";
$proc->{status} = $?;
}
delete $proc->{fh};
delete $proc->{pid};
}
Expand Down

0 comments on commit 674769a

Please sign in to comment.