code: def test_deployments_with_shards_one_shard_fails():
      from docarray import DocList
      from docarray.documents import TextDoc
  
      class TextDocWithId(TextDoc):
          id: str
  
      class KVTestIndexer(Executor):
          """Simulates an indexer where one shard would fail"""
  
          def __init__(self, *args, **kwargs):
              super().__init__(*args, **kwargs)
              self._docs_dict = {}
  
          @requests(on=["/index"])
          def index(
              self, docs: DocList[TextDocWithId], **kwargs
          ) -> DocList[TextDocWithId]:
              for doc in docs:
                  self._docs_dict[doc.id] = doc
  
          @requests(on=["/search"])
          def search(
              self, docs: DocList[TextDocWithId], **kwargs
          ) -> DocList[TextDocWithId]:
              for doc in docs:
                  doc.text = self._docs_dict[doc.id].text
  
      with Deployment(uses=KVTestIndexer, shards=2) as dep:
          index_da = DocList[TextDocWithId](
              [
                  TextDocWithId(id=f"{i}", text=f"ID {i}")
                  for i in range(100)
              ]
          )
          dep.index(
              inputs=index_da,
              request_size=1,
              return_type=DocList[TextDocWithId],
          )
          responses = dep.search(
              inputs=index_da,
              request_size=1,
              return_type=DocList[TextDocWithId],
          )
          for q, r in zip(index_da, responses):
              assert q.text == r.text
  
imports: import os
  import time
  from typing import Any, AsyncGenerator, AsyncIterator, Dict, Generator, Iterator, List, Optional, Union
  import numpy
  import pytest
  from docarray import BaseDoc, DocList
  from docarray.documents import ImageDoc, TextDoc
  from docarray.documents.legacy import LegacyDocument
  from docarray.typing import AnyTensor, ImageUrl, NdArray
  from jina import Client, Deployment, Executor, Flow, dynamic_batching, requests
  from jina.excepts import RuntimeFailToStart
  from jina.helper import random_port
  import uuid
label_desc: Use image node_id 34 for calling a global function with example usage: test_deployments_with_shards_one_shard_fails() without return types