PYTHON-6056 Remove redundant cleanup in TestSearchIndexProse test_case_3 - #3027
Open
blink1073 wants to merge 1 commit into
Open
PYTHON-6056 Remove redundant cleanup in TestSearchIndexProse test_case_3#3027blink1073 wants to merge 1 commit into
blink1073 wants to merge 1 commit into
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets a persistent failure in the Search Index prose test suite by removing a redundant cleanup step in test_case_3, where the test already performs a drop_search_index and waits for list_search_indexes to become empty.
Changes:
- Removed
addCleanup(self.drop_and_wait, ...)from the synchronoustest_case_3. - Removed
addAsyncCleanup(self.drop_and_wait, ...)from the asynchronoustest_case_3.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/test_index_management.py | Removes the extra synchronous cleanup registration from test_case_3. |
| test/asynchronous/test_index_management.py | Removes the extra async cleanup registration from test_case_3. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
213
to
216
| # 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) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-6056
Changes in this PR
PYTHON-6056 (#3012) added
addAsyncCleanup(self.drop_and_wait, self.coll0, _NAME)totest_case_3, but that test already drops the index and waits forlist_search_indexesto return empty in its own body. The test has failed on every run since #3012 merged (confirmed via Evergreen task history: last pass before the merge, failing on every run after).addAsyncCleanup/addCleanupcall fromtest_case_3in both the async source and its generated sync mirror.Test Plan
Run the search_index test: patch
Checklist
Checklist for Author
Checklist for Reviewer