code: def _test_error(flow_kwargs, add_kwargs, error_port=None):
      f = Flow(**flow_kwargs).add(**add_kwargs)
      with f:
          with pytest.raises(ConnectionError) as err_info:
              f.index(inputs=[])
      if error_port:
          assert str(error_port) in err_info.value.args[0]
  
file_path: jina/tests/integration/gateway_clients/test_executor_timeout_failures.py
imports: import multiprocessing
  import time
  import pytest
  from jina import Executor, Flow, requests
label_desc: Use image node_id 1 for calling a global function with example usage: _test_error(flow_kwargs, add_kwargs, error_port) without return types