code: def test_grpc_stream_transient_error_docarray_input(
      flow_or_deployment, port_generator, mocker
  ):
      random_port = port_generator()
      stop_event = multiprocessing.Event()
      start_event = multiprocessing.Event()
      t = multiprocessing.Process(
          target=_start_runtime,
          args=(
              "grpc",
              random_port,
              flow_or_deployment,
              stop_event,
              start_event,
          ),
      )
      t.start()
      start_event.wait(5)
      num_docs = 10
      try:
          client = Client(host=f"grpc://localhost:{random_port}")
  
          on_error_mock = mocker.Mock()
          response = client.post(
              "/",
              DocumentArray.empty(num_docs),
              request_size=1,
              on_error=on_error_mock,
              return_responses=True,
              timeout=0.5,
              max_attempts=5,
              initial_backoff=0.8,
              backoff_multiplier=1.5,
              max_backoff=5,
          )
          assert len(response) == num_docs
  
          on_error_mock.assert_not_called()
      finally:
          stop_event.set()
          t.join(5)
          t.terminate()
  
file_path: jina/tests/unit/clients/python/test_client_errors.py
imports: import multiprocessing
  import os
  import pytest
  from jina import Deployment, DocumentArray, Flow
  from jina.clients import Client
  from jina.clients.base.retry import wait_or_raise_err, sync_wait_or_raise_err
  from tests import random_docs
label_desc: Use image node_id 4 for calling a global function with example usage: test_grpc_stream_transient_error_docarray_input(flow_or_deployment, port_generator, mocker) without return types