code: def test_unmatched_tensor_shape(
      ray_start_single_node, shape, backend
  ):
      world_size = 2
      actors, _ = create_collective_workers(world_size, backend=backend)
      init_tensors_for_gather_scatter(actors, array_size=10)
      list_buffer = [
          np.ones(shape, dtype=np.float32) for _ in range(world_size)
      ]
      ray.get(
          [
              a.set_list_buffer.remote(list_buffer, copy=True)
              for a in actors
          ]
      )
      if shape != 10:
          with pytest.raises(RuntimeError):
              ray.get([a.do_allgather.remote() for a in actors])
      else:
          ray.get([a.do_allgather.remote() for a in actors])
  
file_path: ray/python/ray/util/collective/tests/single_node_cpu_tests/test_allgather.py
imports: import numpy
  import pytest
  import ray
  import torch
  from ray.util.collective.tests.cpu_util import create_collective_workers, init_tensors_for_gather_scatter
  from ray.util.collective.types import Backend
label_desc: Use image node_id 4 for calling a global function with example usage: test_unmatched_tensor_shape(ray_start_single_node, shape, backend) without return types