report errors as E instead of M, and consolidate restarts as simplified roman numerals

This commit is contained in:
yrutschle committed 2021-07-07 19:56:17 +02:00
1 parent bf57d63c3a
commit 8af87ebbad
1 file changed
+5 -1
+5 -1
View File
@@ -130,7 +130,7 @@ sub client {
my $e_l = length $expected; my $e_l = length $expected;
$fd_out->autoflush; $fd_out->autoflush;
my $error = ""; my $error = "";
$error = "M" if $r ne $expected; $error = "E" if $r ne $expected;
print $fd_out ("$client_id\t$r_l\t$error\n"); print $fd_out ("$client_id\t$r_l\t$error\n");
($? = 1, die "$service got [$r] expected [$expected]\n") if ($r ne $expected); ($? = 1, die "$service got [$r] expected [$expected]\n") if ($r ne $expected);
if (rand(1) < $stop_client_probability) { if (rand(1) < $stop_client_probability) {
@@ -245,6 +245,10 @@ if (!fork) {
my ($curr_rcv) = ${$data{$client_id}}[0] + $r_l;; my ($curr_rcv) = ${$data{$client_id}}[0] + $r_l;;
$error //= ""; $error //= "";
my ($curr_error) = "${$data{$client_id}}[1]$error"; my ($curr_error) = "${$data{$client_id}}[1]$error";
# Consolidate into... roman numerals!
$curr_error =~ s/D{10}/X/;
$curr_error =~ s/X{10}/C/;
$curr_error =~ s/C{10}/M/;
$data{$client_id} = [ $r_l + $curr_rcv, "$curr_error$error" ]; $data{$client_id} = [ $r_l + $curr_rcv, "$curr_error$error" ];