[arvados] updated: 2.6.0-99-gdb14d5a61

git repository hosting git at public.arvados.org
Thu May 4 15:52:56 UTC 2023


Summary of changes:
 services/api/test/unit/container_request_test.rb | 25 ++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

       via  db14d5a612dd8db80a97d954f3364f23f21b005d (commit)
      from  505c7b69ad3c29f2ec0413af0d8974e084a7669d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit db14d5a612dd8db80a97d954f3364f23f21b005d
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu May 4 11:51:32 2023 -0400

    20472: Add a couple more cancellation tests
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 931176b8b..fedfe1521 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -394,14 +394,15 @@ class ContainerRequestTest < ActiveSupport::TestCase
     ]
     parents = toplevel_crs.map(&findctr)
 
-    children = parents.map do |parent|
+    children_crs = parents.map do |parent|
       lock_and_run(parent)
       with_container_auth(parent) do
         create_minimal_req!(state: "Committed",
                             priority: 1,
                             environment: {"child" => parent.environment["workflow"]})
       end
-    end.map(&findctr)
+    end
+    children = children_crs.map(&findctr)
 
     grandchildren = children.reverse.map do |child|
       lock_and_run(child)
@@ -476,6 +477,26 @@ class ContainerRequestTest < ActiveSupport::TestCase
     assert_operator 0, :==, children[2].priority
     assert_operator 0, :==, grandchildren[2].priority
     assert_operator shared_grandchild.priority, :==, grandchildren[0].priority
+
+    # cancel a child request, the parent should be > 0 but
+    # the child and grandchild go to 0.
+    children_crs[1].update_attributes!(priority: 0)
+    (parents + children + grandchildren + [shared_grandchild]).map(&:reload)
+    assert_operator 0, :<, parents[1].priority
+    assert_operator parents[0].priority, :>, parents[1].priority
+    assert_operator 0, :==, children[1].priority
+    assert_operator 0, :==, grandchildren[1].priority
+    assert_operator shared_grandchild.priority, :==, grandchildren[0].priority
+
+    # update the parent, it should get a higher priority but the children and
+    # grandchildren should remain at 0
+    toplevel_crs[1].update_attributes!(priority: 6)
+    (parents + children + grandchildren + [shared_grandchild]).map(&:reload)
+    assert_operator 0, :<, parents[1].priority
+    assert_operator parents[0].priority, :<, parents[1].priority
+    assert_operator 0, :==, children[1].priority
+    assert_operator 0, :==, grandchildren[1].priority
+    assert_operator shared_grandchild.priority, :==, grandchildren[0].priority
   end
 
   [

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list