X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6741a2db39cab991efd28d742071170fdbe908f2..586b30b8171da19a4d777c6c2edf4cd7f2fdecfe:/services/api/test/functional/arvados/v1/jobs_controller_test.rb 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 }