[ARVADOS] updated: c2aeaa729c350a33ec47ae1b012e50a6685ac2d2

git at public.curoverse.com git at public.curoverse.com
Tue Apr 15 11:11:53 EDT 2014


Summary of changes:
 .../app/controllers/arvados/v1/jobs_controller.rb  |    2 +-
 services/api/test/fixtures/jobs.yml                |   13 +++++++++++++
 .../arvados/v1/job_reuse_controller_test.rb        |   20 +++++++++++++++++++-
 3 files changed, 33 insertions(+), 2 deletions(-)

       via  c2aeaa729c350a33ec47ae1b012e50a6685ac2d2 (commit)
      from  bb45025e80abc00f8da524d9a78c0bab976d4f3a (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 c2aeaa729c350a33ec47ae1b012e50a6685ac2d2
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Apr 15 11:11:49 2014 -0400

    Job reuse bugfix: do not reuse completed jobs that have NULL output.

diff --git a/services/api/app/controllers/arvados/v1/jobs_controller.rb b/services/api/app/controllers/arvados/v1/jobs_controller.rb
index 40f2def..3a9f624 100644
--- a/services/api/app/controllers/arvados/v1/jobs_controller.rb
+++ b/services/api/app/controllers/arvados/v1/jobs_controller.rb
@@ -27,7 +27,7 @@ class Arvados::V1::JobsController < ApplicationController
                                           script_version: r).
         each do |j|
         if j.nondeterministic != true and
-            j.success != false and
+            ((j.success == true and j.output != nil) or j.running == true) and
             j.script_parameters == resource_attrs[:script_parameters]
           # Record the first job in the list
           if !@object
diff --git a/services/api/test/fixtures/jobs.yml b/services/api/test/fixtures/jobs.yml
index a349229..81e8cb3 100644
--- a/services/api/test/fixtures/jobs.yml
+++ b/services/api/test/fixtures/jobs.yml
@@ -102,6 +102,7 @@ barbaz:
   finished_at: <%= 2.minute.ago.to_s(:db) %>
   running: false
   success: true
+  repository: foo
   output: ea10d51bcf88862dbcc36eb292017dfd+45
   priority: ~
   log: d41d8cd98f00b204e9800998ecf8427e+0
@@ -122,6 +123,18 @@ previous_job_run:
     input: fa7aeb5140e2848d39b416daeef4ffc5+45
     an_integer: "1"
   success: true
+  output: ea10d51bcf88862dbcc36eb292017dfd+45
+
+previous_job_run_no_output:
+  uuid: zzzzz-8i9sb-cjs4pklxxjykppp
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  script: hash
+  script_version: 4fe459abe02d9b365932b8f5dc419439ab4e2577
+  script_parameters:
+    input: fa7aeb5140e2848d39b416daeef4ffc5+45
+    an_integer: "2"
+  success: true
+  output: ~
 
 nondeterminisic_job_run:
   uuid: zzzzz-8i9sb-cjs4pklxxjykyyy
diff --git a/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb b/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
index 03e577f..16916b7 100644
--- a/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
 load 'test/functional/arvados/v1/git_setup.rb'
 
 class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
-  fixtures :repositories, :users, :jobs, :links
+  fixtures :repositories, :users, :jobs, :links, :collections
 
   # See git_setup.rb for the commit log for test.git.tar
   include GitSetup
@@ -26,6 +26,24 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
     assert_equal '4fe459abe02d9b365932b8f5dc419439ab4e2577', new_job['script_version']
   end
 
+  test "test_cannot_reuse_job_no_output" do
+    @controller = Arvados::V1::JobsController.new
+    authorize_with :active
+    post :create, job: {
+      script: "hash",
+      script_version: "4fe459abe02d9b365932b8f5dc419439ab4e2577",
+      repository: "foo",
+      script_parameters: {
+        input: 'fa7aeb5140e2848d39b416daeef4ffc5+45',
+        an_integer: '2'
+      }
+    }
+    assert_response :success
+    assert_not_nil assigns(:object)
+    new_job = JSON.parse(@response.body)
+    assert_not_equal 'zzzzz-8i9sb-cjs4pklxxjykppp', new_job['uuid']
+  end
+
   test "test_reuse_job_range" do
     @controller = Arvados::V1::JobsController.new
     authorize_with :active

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list