[ARVADOS] created: 5e81b09c9023711cd193569a1ec877c9d7bb8953

Git user git at public.curoverse.com
Wed Sep 21 22:51:59 EDT 2016


        at  5e81b09c9023711cd193569a1ec877c9d7bb8953 (commit)


commit 5e81b09c9023711cd193569a1ec877c9d7bb8953
Author: radhika <radhika at curoverse.com>
Date:   Wed Sep 21 22:50:24 2016 -0400

    10036: Use status label "Ready" for a canceled container request (priority 0), when it's container_uuid is in Queued or Locked states.

diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index be526ca..b6e72dc 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -81,7 +81,9 @@ class ContainerWorkUnit < ProxyWorkUnit
   def state_label
     ec = exit_code
     return "Failed" if (ec && ec != 0)
-    get_combined(:state)
+    state = get_combined(:state)
+    return "Ready" if ((priority == 0) and (["Queued", "Locked"].include?(state)))
+    state
   end
 
   def exit_code
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index 68bc2fd..550f218 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -12,6 +12,10 @@ class WorkUnitTest < ActiveSupport::TestCase
     [PipelineInstance, 'pipeline_with_tagged_collection_input', "pwu", 1, "Ready", nil, 0.0],
     [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_running_container', 'cwu', 0, "Running", nil, 0.0],
   ].each do |type, fixture, label, num_children, state, success, progress|
     test "children of #{fixture}" do
       use_token 'active'
diff --git a/services/api/test/fixtures/container_requests.yml b/services/api/test/fixtures/container_requests.yml
index 49a1fae..546b3f0 100644
--- a/services/api/test/fixtures/container_requests.yml
+++ b/services/api/test/fixtures/container_requests.yml
@@ -189,6 +189,63 @@ cr_for_failed:
     vcpus: 1
     ram: 123
 
+canceled_with_queued_container:
+  uuid: zzzzz-xvhdp-canceledqueuedc
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: canceled with queued container
+  state: Committed
+  priority: 0
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-queuedcontainer
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
+canceled_with_locked_container:
+  uuid: zzzzz-xvhdp-canceledlocekdc
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: canceled with locked container
+  state: Committed
+  priority: 0
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-lockedcontainer
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
+canceled_with_running_container:
+  uuid: zzzzz-xvhdp-canceledrunning
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: canceled with running container
+  state: Committed
+  priority: 0
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-runningcontainr
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
 uncommitted:
   uuid: zzzzz-xvhdp-cr4uncommittedc
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list