From: radhika Date: Thu, 25 Sep 2014 16:32:55 +0000 (-0400) Subject: 3889: split the test "cancel a running job" into two tests: one that cancels a runnin... X-Git-Tag: 1.1.0~2151^2~22 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/586b30b8171da19a4d777c6c2edf4cd7f2fdecfe 3889: split the test "cancel a running job" into two tests: one that cancels a running job and another that cancels an already cancelled job. --- diff --git a/services/api/test/functional/arvados/v1/jobs_controller_test.rb b/services/api/test/functional/arvados/v1/jobs_controller_test.rb index a9a49a0d5f..03ee3df2e2 100644 --- a/services/api/test/functional/arvados/v1/jobs_controller_test.rb +++ b/services/api/test/functional/arvados/v1/jobs_controller_test.rb @@ -81,9 +81,19 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase assert_equal(true, File.exists?(Rails.configuration.crunch_refresh_trigger), 'trigger file should be created when job is cancelled') + end + + test "cancelling a cancelled jobs stays cancelled" do + # We need to verify that "cancel" creates a trigger file, so first + # let's make sure there is no stale trigger file. + begin + File.unlink(Rails.configuration.crunch_refresh_trigger) + rescue Errno::ENOENT + end + authorize_with :active put :update, { - id: jobs(:running).uuid, + id: jobs(:running_cancelled).uuid, job: { cancelled_at: nil }