def test_idErrorWhenImageDownloading(self):
        """A test ensure image download is not raising 500 error when there is an invalid _id.

        Image download use the document _id to generate a unique thread id.
        However, the image download happens before validate the document _id.
        This test ensures that the image download does not raise a 500 error when the document _id is invalid.
        """
        test_docs = [
            {
                "image_field_1": TestImageUrls.IMAGE1.value,
                 "text_field_1": "this is a valid image",
                 "_id": "1"
            },
            {
                "image_field_1": TestImageUrls.IMAGE2.value,
                "text_field_1": "this is a invalid image due to int id",
                "_id": 2
            },
            {
                "image_field_1": TestImageUrls.IMAGE3.value,
                "text_field_1": "this is a invalid image due to None",
                "_id": None
            },
            {
                "image_field_1": TestImageUrls.IMAGE4.value,
                "text_field_1": "this is a invalid image due to ",
                "_id": []
            }
        ]

        for index_name in [self.unstructured_marqo_index_name, self.semi_structured_marqo_index_name,
                           self.structured_marqo_index_name]:
            tensor_fields = ["image_field_1", "text_field_1"] if index_name != self.structured_marqo_index_name \
                else None
            with self.subTest(index_name):
                r = self.add_documents(
                    config=self.config,
                    add_docs_params=AddDocsParams(
                        index_name=index_name,
                        docs=test_docs,
                        tensor_fields=tensor_fields)
                ).dict(exclude_none=True, by_alias=True)
                self.assertEqual(True, r["errors"])
                self.assertEqual(4, len(r["items"]))
                self.assertEqual(200, r["items"][0]["status"])
                for i in range(1, 4):
                    self.assertEqual(400, r["items"][i]["status"])
                    self.assertIn("Document _id must be a string", r["items"][i]["error"])
A test ensure image download is not raising 500 error when there is an invalid _id.

        Image download use the document _id to generate a unique thread id.
        However, the image download happens before validate the document _id.
        This test ensures that the image download does not raise a 500 error when the document _id is invalid.
        
tests/integ_tests/tensor_search/integ_tests/test_add_documents_combined.py