def test_use_existing_tensors_dupe_ids(self):
        """
        Should only use the latest inserted ID. Make sure it doesn't get the first/middle one
        """

        self.add_documents(config=self.config, add_docs_params=AddDocsParams(
            index_name=self.index_name_1, docs=[
                {
                    "_id": "3",
                    "title": "doc 3b"
                },

            ], auto_refresh=True, device="cpu"))

        doc_3_solo = tensor_search.get_document_by_id(
            config=self.config, index_name=self.index_name_1,
            document_id="3", show_vectors=True)

        tensor_search.delete_index(config=self.config, index_name=self.index_name_1)
        tensor_search.create_vector_index(config=self.config, index_name=self.index_name_1)
        self.add_documents(config=self.config, add_docs_params=AddDocsParams(
            index_name=self.index_name_1, docs=[
                {
                    "_id": "1",
                    "title": "doc 1"
                },
                {
                    "_id": "2",
                    "title": "doc 2",
                },
                {
                    "_id": "3",
                    "title": "doc 3a",
                },
                {
                    "_id": "3",
                    "title": "doc 3b"
                }],
            auto_refresh=True, use_existing_tensors=True, device="cpu"))

        doc_3_duped = tensor_search.get_document_by_id(
            config=self.config, index_name=self.index_name_1,
            document_id="3", show_vectors=True)

        self.assertEqual(doc_3_solo, doc_3_duped)

        self.add_documents(config=self.config, add_docs_params=AddDocsParams(
            index_name=self.index_name_1, docs=[
                {
                    "_id": "1",
                    "title": "doc 1"
                },
                {
                    "_id": "2",
                    "title": "doc 2",
                },
                {
                    "_id": "3",
                    "title": "doc 3a",
                },
                {
                    "_id": "3",
                    "title": "doc 3b"
                },

            ], auto_refresh=True, use_existing_tensors=True, device="cpu"))

        doc_3_overwritten = tensor_search.get_document_by_id(
            config=self.config, index_name=self.index_name_1,
            document_id="3", show_vectors=True)

        # Needs to be 3b, not 3a
        self.assertEqual(doc_3_duped, doc_3_overwritten)

        Should only use the latest inserted ID. Make sure it doesn't get the first/middle one
        
tests/integ_tests/tensor_search/test_add_documents_use_existing_tensors.py