18948: Update test.
authorTom Clegg <tom@curii.com>
Fri, 24 Jun 2022 14:05:17 +0000 (10:05 -0400)
committerTom Clegg <tom@curii.com>
Fri, 24 Jun 2022 14:05:33 +0000 (10:05 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/api/test/unit/container_test.rb

index 685bd15e6587a8ff167b9b207c4db0a50320e665..bcf99da2e3442ba088d9effbe80a633e6467f857 100644 (file)
@@ -870,16 +870,14 @@ class ContainerTest < ActiveSupport::TestCase
     end
   end
 
-  test "Container only set exit code on complete" do
+  test "can only change exit code while running and at completion" do
     set_user_from_auth :active
     c, _ = minimal_new
     set_user_from_auth :dispatch1
     c.lock
+    check_illegal_updates c, [{exit_code: 1}]
     c.update_attributes! state: Container::Running
-
-    check_illegal_updates c, [{exit_code: 1},
-                              {exit_code: 1, state: Container::Cancelled}]
-
+    assert c.update_attributes(exit_code: 1)
     assert c.update_attributes(exit_code: 1, state: Container::Complete)
   end