[ARVADOS] created: 8dd7e323798d36e3182c12868c6f1f3dd0eabf96
Git user
git at public.curoverse.com
Wed May 3 16:20:47 EDT 2017
at 8dd7e323798d36e3182c12868c6f1f3dd0eabf96 (commit)
commit 8dd7e323798d36e3182c12868c6f1f3dd0eabf96
Author: radhika <radhika at curoverse.com>
Date: Wed May 3 16:20:08 2017 -0400
11250: when a container's priority is zero and in Queued state, show the state as "Cancelled"
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index ed82f18..16462f7 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -81,8 +81,11 @@ class ContainerWorkUnit < ProxyWorkUnit
def state_label
ec = exit_code
return "Failed" if (ec && ec != 0)
+
state = get_combined(:state)
- return "Ready" if ((priority == 0) and (["Queued", "Locked"].include?(state)))
+
+ return "Queued" if state == "Locked"
+ return "Cancelled" if ((priority == 0) and (state == "Queued"))
state
end
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index 8bbbb5c..1932b75 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -16,8 +16,8 @@ class WorkUnitTest < ActiveSupport::TestCase
[Container, 'requester', 'cwu', 1, "Complete", true, 1.0],
[ContainerRequest, 'cr_for_requester', 'cwu', 1, "Complete", true, 1.0],
[ContainerRequest, 'queued', 'cwu', 0, "Queued", nil, 0.0], # priority 1
- [ContainerRequest, 'canceled_with_queued_container', 'cwu', 0, "Ready", nil, 0.0],
- [ContainerRequest, 'canceled_with_locked_container', 'cwu', 0, "Ready", nil, 0.0],
+ [ContainerRequest, 'canceled_with_queued_container', 'cwu', 0, "Cancelled", false, 0.0],
+ [ContainerRequest, 'canceled_with_locked_container', 'cwu', 0, "Queued", nil, 0.0],
[ContainerRequest, 'canceled_with_running_container', 'cwu', 1, "Running", nil, 0.0],
].each do |type, fixture, label, num_children, state, success, progress|
test "children of #{fixture}" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list