code: def test_sender_upsert_run(internal_sm, test_settings, mock_run):
      run = mock_run(use_magic_mock=True)
      run_proto = InterfaceBase()._make_run(run)
      record = pb.Record(run=run_proto)
      record.control.mailbox_slot = "0"
  
      send_manager = internal_sm(test_settings())
      results = []
      with unittest.mock.patch.object(
          send_manager._api, "upsert_run", side_effect=CommError("test")
      ):
          with unittest.mock.patch.object(
              send_manager,
              "_respond_result",
              wraps=lambda x: results.append(x),
          ):
              send_manager.send_run(record)
  
      assert len(results) == 1
      assert results[0].run_result.error.message == "test"
  
imports: import json
  import os
  import shutil
  import threading
  import time
  import unittest.mock
  import pytest
  import wandb
  from wandb.errors import CommError
  from wandb.proto import wandb_internal_pb2
  from wandb.sdk.interface.interface import InterfaceBase
  from wandb.sdk.lib import filesystem
label_desc: Use image node_id 20 for calling a global function with example usage: test_sender_upsert_run(internal_sm, test_settings, mock_run) without return types