code: def test_add_metadata_doesnt_update_local_on_rest_failure(
      sample_checkpoint: checkpoint.Checkpoint,
  ) -> None:
      sample_checkpoint.metadata = {}
  
      responses.post(
          re.compile(
              f"{_MASTER}/api/v1/checkpoints/{sample_checkpoint.uuid}.*"
          ),
          status=400,
      )
  
      try:
          sample_checkpoint.add_metadata({"test": "test"})
          raise AssertionError("Server's 400 should raise an exception")
      except api.errors.APIException:
          assert "test" not in sample_checkpoint.metadata
  
file_path: determined/harness/tests/determined/common/experimental/test_checkpoint.py
imports: import os
  import re
  from typing import Dict, Optional, Union, cast
  from unittest import mock
  import pytest
  import responses
  from determined.common import api, storage
  from determined.common.experimental import checkpoint
  from tests.fixtures import api_responses
label_desc: Use image node_id 6 for calling a global function with example usage: test_add_metadata_doesnt_update_local_on_rest_failure(sample_checkpoint) without return types