File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
model_engine_server/infra/services
tests/unit/infra/services Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ async def update_model_endpoint(
312312
313313 if record .current_model_bundle .id != model_bundle_id :
314314 if metadata is None :
315- metadata = {}
315+ metadata = record . metadata if record . metadata is not None else {}
316316 # MODEL_BUNDLE_CHANGED_KEY will be checked during _create_deployment in K8SEndpointResourceDelegate
317317 metadata [MODEL_BUNDLE_CHANGED_KEY ] = True
318318
Original file line number Diff line number Diff line change @@ -238,6 +238,17 @@ async def test_create_update_model_endpoint_success(
238238 assert model_endpoint .infra_state .deployment_state .max_workers == update_kwargs ["max_workers" ]
239239 assert model_endpoint .infra_state .labels == update_kwargs ["labels" ]
240240
241+ # Now update min_worker only
242+ update_kwargs : Any = dict (
243+ min_workers = 2 ,
244+ )
245+ updated_model_endpoint_record = await fake_live_model_endpoint_service .update_model_endpoint (
246+ model_endpoint_id = model_endpoint_record .id , ** update_kwargs
247+ )
248+
249+ # Make sure metadata is not updated
250+ assert updated_model_endpoint_record .metadata == {"some_new_key" : "some_new_values" }
251+
241252
242253@pytest .mark .skip (reason = "Exception is temporarily disabled due to lock flakiness" )
243254@pytest .mark .asyncio
You can’t perform that action at this time.
0 commit comments