def test_race_condition(self):
        """
        In this test, we simulate two instances/threads of Marqo make different changes to the application package
        """
        self.index_management.bootstrap_vespa()

        request1 = self.unstructured_marqo_index_request()
        request2 = self.structured_marqo_index_request(
            fields=[FieldRequest(name='title', type=FieldType.Text)],
            tensor_fields=['title']
        )
        schema1, index1 = vespa_schema_factory(request1).generate_schema()
        schema2, index2 = vespa_schema_factory(request2).generate_schema()

        content_base_url1, prepare_url1 = self.vespa_client.create_deployment_session()
        store1 = ApplicationPackageDeploymentSessionStore(content_base_url1, self.vespa_client)
        app1 = VespaApplicationPackage(store1)

        content_base_url2, prepare_url2 = self.vespa_client.create_deployment_session()
        store2 = ApplicationPackageDeploymentSessionStore(content_base_url2, self.vespa_client)
        app2 = VespaApplicationPackage(store2)

        app1.batch_add_index_setting_and_schema([(schema1, index1)])
        app2.batch_add_index_setting_and_schema([(schema2, index2)])

        prepare_res1 = self.vespa_client.prepare(prepare_url1)
        self.vespa_client.activate(prepare_res1['activate'])

        prepare_res2 = self.vespa_client.prepare(prepare_url2)
        # this should fail due to optimistic locking
        with self.assertRaisesStrict(VespaActivationConflictError):
            self.vespa_client.activate(prepare_res2['activate'])

        In this test, we simulate two instances/threads of Marqo make different changes to the application package
        
tests/integ_tests/core/index_management/test_index_management.py