code: def test_distributed_replicas_hosts_mismatch(input_docs):
      ports = [random_port(), random_port()]
      args1, args2 = _external_deployment_args(
          num_shards=1, port=ports[0]
      ), _external_deployment_args(num_shards=1, port=ports[1])
      depl1 = Deployment(args1)
      depl2 = Deployment(args2)
      with depl1, depl2:
          with pytest.raises(ValueError) as err_info:
              flow = Flow().add(
                  host=["localhost", "localhost"],
                  port=ports,
                  external=True,
                  replicas=3,
              )
              with flow:
                  pass
      assert (
          "Number of hosts (2) does not match the number of replicas (3)"
          in err_info.value.args[0]
      )
  
file_path: jina/tests/integration/distributed-replicas/test_distributed_replicas.py
imports: import os
  import time
  import pytest
  from docarray import Document, DocumentArray
  from jina import Flow
  from jina.helper import random_port
  from jina.orchestrate.deployments import Deployment
  from jina.parsers import set_deployment_parser
label_desc: Use image node_id 6 for calling a global function with example usage: test_distributed_replicas_hosts_mismatch(input_docs) without return types