code: def test_unmatched_tensor_list_length(
      ray_start_single_node_2_gpus, length
  ):
      world_size = 2
      actors, _ = create_collective_workers(world_size)
      list_buffer = [
          cp.ones(10, dtype=cp.float32) for _ in range(length)
      ]
      ray.wait([a.set_list_buffer.remote(list_buffer) for a in actors])
      if length != world_size:
          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_gpu_tests/test_allgather.py
imports: import pytest
  import ray
  import cupy
  import torch
  from ray.util.collective.tests.util import create_collective_workers, init_tensors_for_gather_scatter
label_desc: Use image node_id 3 for calling a global function with example usage: test_unmatched_tensor_list_length(ray_start_single_node_2_gpus, length) without return types