Skip to content

Commit

Permalink
WIP test
Browse files Browse the repository at this point in the history
  • Loading branch information
elliefm committed Jun 26, 2024
1 parent be0699c commit 1c9ad1c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion cassandane/Cassandane/Cyrus/Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ EOF
$self->assert_str_equals("test\r\n", $res->{1}{binary});
}

sub test_fatals_abort
sub test_fatals_abort_enabled
:NoStartInstances
{
my ($self) = @_;
Expand Down Expand Up @@ -335,4 +335,30 @@ sub test_fatals_abort
}
}

sub test_fatals_abort_disabled
:NoStartInstances
{
my ($self) = @_;

$self->{instance}->{config}->set(
'fatals_abort' => 'no',
'prometheus_enabled' => 'no',
);
$self->_start_instances();

my $basedir = $self->{instance}->get_basedir();

# run `promstatsd -1` without having set up for prometheus, which should
# produce a "Prometheus metrics are not being tracked..." fatal error
eval {
$self->{instance}->run_command({ cyrus => 1 }, 'promstatsd', '-1');
};
my $e = $@;
$self->assert_not_null($e);
$self->assert_matches(qr{promstatsd pid \d+\) exited with code 78},
$e->{'-text'});

# post-test sanity checks will complain for us if a core was left behind
}

1;

0 comments on commit 1c9ad1c

Please sign in to comment.