[ARVADOS] updated: 1.1.2-59-gc7a6ab3

Git user git at public.curoverse.com
Wed Jan 17 16:33:47 EST 2018


Summary of changes:
 services/api/test/unit/container_request_test.rb | 1 +
 1 file changed, 1 insertion(+)

  discards  56461e4a9d3d8b440397403a0e1137913e9145ba (commit)
       via  c7a6ab35c1537d2766bdaaa7fec83a15c5454094 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (56461e4a9d3d8b440397403a0e1137913e9145ba)
            \
             N -- N -- N (c7a6ab35c1537d2766bdaaa7fec83a15c5454094)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 c7a6ab35c1537d2766bdaaa7fec83a15c5454094
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Jan 15 11:21:25 2018 -0500

    12916: Do not set output_uuid on request when container fails.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/doc/api/methods/container_requests.html.textile.liquid b/doc/api/methods/container_requests.html.textile.liquid
index 1c2550f..b5502ba 100644
--- a/doc/api/methods/container_requests.html.textile.liquid
+++ b/doc/api/methods/container_requests.html.textile.liquid
@@ -55,7 +55,7 @@ table(table table-bordered table-condensed).
 |use_existing|boolean|If possible, use an existing (non-failed) container to satisfy the request instead of creating a new one.|Default is true|
 |log_uuid|string|Log collection containing log messages provided by the scheduler and crunch processes.|Null if the container has not yet completed.|
 |output_uuid|string|Output collection created when the container finished successfully.|Null if the container has failed or not yet completed.|
-|filters|string|Additional constraints for satisfying the container_request, given in the same form as the filters parameter accepted by the container_requests.list API.|
+|filters|string|Additional constraints for satisfying the container_request, given in the same form as the filters parameter accepted by the container_requests.list API.||
 
 h2(#priority). Priority
 
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index 3596bf3..bf90324 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -134,7 +134,9 @@ class ContainerRequest < ArvadosModel
                             })
       coll.save_with_unique_name!
       if out_type == 'output'
-        out_coll = coll.uuid
+        if c.state == Container::Complete && c.exit_code == 0
+          out_coll = coll.uuid
+        end
       else
         log_coll = coll.uuid
       end
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 0edc0f4..8091f71 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -245,6 +245,7 @@ class ContainerRequestTest < ActiveSupport::TestCase
     log_pdh = 'fa7aeb5140e2848d39b416daeef4ffc5+45'
     act_as_system_user do
       c.update_attributes!(state: Container::Complete,
+                           exit_code: 0,
                            output: output_pdh,
                            log: log_pdh)
     end
@@ -613,6 +614,22 @@ class ContainerRequestTest < ActiveSupport::TestCase
     assert_not_equal cr2.container_uuid, cr.container_uuid
   end
 
+  [
+    ['failed', {exit_code: 1, end_state: Container::Complete}],
+    ['cancelled', {exit_code: nil, end_state: Container::Cancelled}],
+  ].each do |label, fate|
+    test "output_uuid not set after container #{label}" do
+      set_user_from_auth :active
+      cr = create_minimal_req!(priority: 1,
+                               container_count_max: 1,
+                               state: ContainerRequest::Committed)
+      run_container(cr, exit_code: fate[:exit_code], end_state: fate[:end_state])
+      cr.reload
+      assert_not_nil cr.log_uuid
+      assert_nil cr.output_uuid
+    end
+  end
+
   test "Output collection name setting using output_name with name collision resolution" do
     set_user_from_auth :active
     output_name = 'unimaginative name'
@@ -673,13 +690,13 @@ class ContainerRequestTest < ActiveSupport::TestCase
     assert_in_delta(delete, now + year, 10)
   end
 
-  def run_container(cr)
+  def run_container(cr, end_state: Container::Complete, exit_code: 0)
     act_as_system_user do
       c = Container.find_by_uuid(cr.container_uuid)
       c.update_attributes!(state: Container::Locked)
       c.update_attributes!(state: Container::Running)
-      c.update_attributes!(state: Container::Complete,
-                           exit_code: 0,
+      c.update_attributes!(state: end_state,
+                           exit_code: exit_code,
                            output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45',
                            log: 'fa7aeb5140e2848d39b416daeef4ffc5+45')
       c

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list