Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
<span class="badge badge-secondary">inactive</span>
% }
</td>
% if (grep { $job->{state} eq $_ } qw(active finished failed)) {
% my $end = $job->{state} eq 'active' ? 'time' : 'finished';
% my $end = $job->{state} eq 'active' ? 'time' : 'finished';
% if ((grep { $job->{state} eq $_ } qw(active finished failed)) && defined $job->{started} && defined $job->{$end}) {
% my $runtime = $job->{$end} - $job->{started};
<td class="accordion-toggle collapsed duration" data-toggle="collapse" data-target="#job<%= $i %>">
<%= $runtime %>
Expand Down
9 changes: 9 additions & 0 deletions t/pg_admin.t
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ subtest 'Jobs' => sub {
->text_unlike('tbody td a' => qr/$inactive/);
};

subtest 'Failed job without timestamps' => sub {
my $stuck = app->minion->enqueue('test');
app->minion->backend->pg->db->query("UPDATE minion_jobs SET state = 'failed' WHERE id = ?", $stuck);
my @warnings;
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
$t->get_ok('/minion/jobs?state=failed')->status_is(200)->text_like('tbody td a' => qr/$stuck/);
is_deeply \@warnings, [], 'no uninitialized value warnings';
};

subtest 'Workers' => sub {
$t->get_ok('/minion/workers')->status_is(200)->element_exists_not('tbody td a');
my $worker = app->minion->worker->register;
Expand Down