If the test script die()d before running the first test, the whole test
was interpreted as SKIPped rather than failed. The PostgreSQL::Cluster
module got this right.
Backpatch to all supported versions.
Discussion: https://www.postgresql.org/message-id/
fb898a70-3a88-4629-88e9-
f2375020061d@iki.fi
index e51e87d0a2ec65e81c0e9ad80b1cfa4dfb74edeb..ec311bfed8cc918c388f567a5942b4c89fd88534 100644 (file)
@@ -203,7 +203,12 @@ system_or_bail $krb5kdc, '-P', $kdc_pidfile;
END
{
+ # take care not to change the script's exit value
+ my $exit_code = $?;
+
kill 'INT', `cat $kdc_pidfile` if defined($kdc_pidfile) && -f $kdc_pidfile;
+
+ $? = $exit_code;
}
note "setting up PostgreSQL instance";
index 91cd9e3762218c0cb8b434a2ace16a9beecdfe4d..3866a56e0a6b4640e99b82dfea8ee40c146258b2 100644 (file)
END
{
+ # take care not to change the script's exit value
+ my $exit_code = $?;
+
foreach my $server (@servers)
{
next unless -f $server->{pidfile};
chomp $pid;
kill 'INT', $pid;
}
+
+ $? = $exit_code;
}
=pod