[ARVADOS] updated: 2.1.0-230-g30c06f38c
Git user
git at public.arvados.org
Mon Jan 4 17:20:37 UTC 2021
Summary of changes:
services/api/app/models/container_request.rb | 18 ++----------------
.../arvados/v1/container_requests_controller_test.rb | 4 ++--
2 files changed, 4 insertions(+), 18 deletions(-)
via 30c06f38c84496df0954661e06c8e6d321697ef4 (commit)
from 34f9f86a5433f51bc05c70613a6615f6c187756c (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 30c06f38c84496df0954661e06c8e6d321697ef4
Author: Nico Cesar <nico at nicocesar.com>
Date: Mon Jan 4 12:19:45 2021 -0500
Revert "17014: Fixes functional tests."
This reverts commit 22895df84dadaa0c2101443f765a3436b0282643.
Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index 51fda5469..7012c1c32 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -31,7 +31,6 @@ class ContainerRequest < ArvadosModel
serialize :scheduling_parameters, Hash
before_validation :fill_field_defaults, :if => :new_record?
- before_validation :forget_innocuous_serialized_fields_updates, on: :update
before_validation :validate_runtime_constraints
before_validation :set_default_preemptible_scheduling_parameter
before_validation :set_container
@@ -345,19 +344,6 @@ class ContainerRequest < ArvadosModel
end
end
- # Updates to serialized fields are all-or-nothing. Here we avoid making
- # unnecessary updates.
- def forget_innocuous_serialized_fields_updates
- forgettable_attrs = []
- if (runtime_constraints.to_a - runtime_constraints_was.to_a).empty?
- forgettable_attrs.append('runtime_constraints')
- end
- if (scheduling_parameters.to_a - scheduling_parameters_was.to_a).empty?
- forgettable_attrs.append('scheduling_parameters')
- end
- self.clear_attribute_changes(forgettable_attrs) if !forgettable_attrs.empty?
- end
-
def validate_runtime_constraints
case self.state
when Committed
@@ -483,12 +469,12 @@ class ContainerRequest < ArvadosModel
# see https://dev.arvados.org/issues/17014#note-28 for details
AttrsRuntimeConstraintsDefaults.each do |key, value|
- if attributes["runtime_constraints"] && !attributes["runtime_constraints"].key?(key)
+ if !attributes["runtime_constraints"].key?(key)
attributes["runtime_constraints"][key] = value
end
end
AttrsSchedulingParametersDefaults.each do |key, value|
- if attributes["scheduling_parameters"] && !attributes["scheduling_parameters"].key?(key)
+ if !attributes["scheduling_parameters"].key?(key)
attributes["scheduling_parameters"][key] = value
end
end
diff --git a/services/api/test/functional/arvados/v1/container_requests_controller_test.rb b/services/api/test/functional/arvados/v1/container_requests_controller_test.rb
index a5e946e19..ceb94fe92 100644
--- a/services/api/test/functional/arvados/v1/container_requests_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/container_requests_controller_test.rb
@@ -62,7 +62,7 @@ class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase
assert_equal 'bar', req.secret_mounts['/foo']['content']
end
- test "cancel with runtime_constraints and scheduling_params with default values" do
+ test "runtime constraints with default values" do
authorize_with :active
req = container_requests(:queued)
@@ -77,7 +77,7 @@ class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase
'keep_cache_ram' => 0,
},
scheduling_parameters: {
- "preemptible"=>nil
+ "preemptible"=>false
}
},
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list