Skip to content

Commit

Permalink
Merge pull request #6073 from r-richardson/164084_high_load_improve_w…
Browse files Browse the repository at this point in the history
…ording

Make 'Broken' workers show as 'Unavailable' instead
  • Loading branch information
mergify[bot] authored Dec 2, 2024
2 parents 5a51b93 + bff1577 commit db480fd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/javascripts/admin_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function loadWorkerTable() {
select.append('<option value="Idle">Idle</option>');
select.append('<option value="Offline">Offline</option>');
select.append('<option value="Working">Working</option>');
select.append('<option value="Broken">Broken</option>');
select.append('<option value="Unavailable">Unavailable</option>');
select.val('Idle');
});
this.api().column(4).search('Idle').draw();
Expand Down
3 changes: 2 additions & 1 deletion lib/OpenQA/Worker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,8 @@ sub _check_system_utilization (
return undef unless $threshold && @$load >= 3;
# look at the load evolution over time to react quick enough if the load
# rises but accept a falling edge
return "The average load (@$load) is exceeding the configured threshold of $threshold."
return
"The average load (@$load) is exceeding the configured threshold of $threshold. The worker will temporarily not accept new jobs until the load is lower again."
if max(@$load) > $threshold && ($load->[0] > $load->[1] || $load->[0] > $load->[2] || min(@$load) > $threshold);
return undef;
}
Expand Down
4 changes: 2 additions & 2 deletions t/ui/15-admin-workers.t
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ subtest 'worker overview' => sub {
$driver->find_element("tr#worker_$broken_worker_id .help_popover")->click();
is(
$driver->find_element("tr#worker_$broken_worker_id .status")->get_text(),
'Broken', "worker $broken_worker_id is broken",
'Unavailable', "worker $broken_worker_id is broken and displayed as unavailable",
);
like($driver->find_element('.popover')->get_text(), qr/Error\nout of order/, 'reason for brokenness shown');
like($driver->find_element('.popover')->get_text(), qr/Details\nout of order/, 'reason for brokenness shown');
};

# test delete offline worker function
Expand Down
2 changes: 1 addition & 1 deletion templates/webapi/admin/workers/worker_status.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
%>
% } elsif ($worker->{status} eq 'broken') {
Broken <%= help_popover(Error => $worker->{error}) %>
Unavailable <%= help_popover(Details => $worker->{error}) %>
% } elsif ($worker->{alive}) {
Idle
% } else {
Expand Down

0 comments on commit db480fd

Please sign in to comment.