From f243f22edffc14d8e2129de9219e788170ecb4e5 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 31 Aug 2026 17:42:02 -0500 Subject: [PATCH] PYTHON-6056 Remove redundant cleanup in TestSearchIndexProse test_case_3 test_case_3 already drops the index and waits for it to disappear in its own body. The addCleanup added by PYTHON-6056 ran drop_search_index a second time in teardown against an already-deleted index, and the server's IndexNotFound (code 27) isn't in drop_search_index's allowable_errors, so it raised and failed the test on every run since that PR merged. --- test/asynchronous/test_index_management.py | 1 - test/test_index_management.py | 1 - 2 files changed, 2 deletions(-) diff --git a/test/asynchronous/test_index_management.py b/test/asynchronous/test_index_management.py index 59ce89e686..4b2a9c813b 100644 --- a/test/asynchronous/test_index_management.py +++ b/test/asynchronous/test_index_management.py @@ -213,7 +213,6 @@ async def test_case_3(self): # Create a new search index on ``self.coll0``. model = {"name": _NAME, "definition": {"mappings": {"dynamic": False}}} resp = await self.coll0.create_search_index(model) - self.addAsyncCleanup(self.drop_and_wait, self.coll0, _NAME) # Assert that the command returns the name of the index: ``"test-search-index"``. self.assertEqual(resp, "test-search-index") diff --git a/test/test_index_management.py b/test/test_index_management.py index 557f9ab93d..9d36ea0416 100644 --- a/test/test_index_management.py +++ b/test/test_index_management.py @@ -211,7 +211,6 @@ def test_case_3(self): # Create a new search index on ``self.coll0``. model = {"name": _NAME, "definition": {"mappings": {"dynamic": False}}} resp = self.coll0.create_search_index(model) - self.addCleanup(self.drop_and_wait, self.coll0, _NAME) # Assert that the command returns the name of the index: ``"test-search-index"``. self.assertEqual(resp, "test-search-index")