Enhance TestmonXdistSync registration and initialization#260
Open
jogendra-india wants to merge 2 commits intotarpas:mainfrom
Open
Enhance TestmonXdistSync registration and initialization#260jogendra-india wants to merge 2 commits intotarpas:mainfrom
jogendra-india wants to merge 2 commits intotarpas:mainfrom
Conversation
Register TestmonXdistSync plugin conditionally based on xdist usage and modify its constructor to accept a should_collect parameter.
Owner
|
I don't see the test file in the commit. (Force add it pls) I think I would delete most of the code comments. |
Add integration tests for pytest-xdist with testmon to verify proper handling of worker coordination and database locking issues.
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.
Description
Fixes #259
This PR fixes the
sqlite3.OperationalError: database is lockederror that occurs when using--testmon --testmon-nocollectwith pytest-xdist.Problem
When
--testmon-nocollectis used,TestmonXdistSyncwas not registered because it was inside theif should_collect:block. This meant:testmon_exec_idfrom the controller viapytest_configure_nodehookTestmonData.for_local_run()(write mode) instead offor_worker()(read-only)Solution
TestmonXdistSyncregistration to theif should_select or should_collect:block, so it's registered whenever testmon is activeshould_collectparameter toTestmonXdistSync.__init__()to track whether collection is activesync_db_fs_tests()inpytest_xdist_node_collection_finished()when in nocollect mode (since DB is read-only)Changes
testmon/pytest_testmon.pyregister_plugins()to registerTestmonXdistSyncin theif should_select or should_collect:blockshould_collectparameter toTestmonXdistSync.__init__()pytest_xdist_node_collection_finished()to checkself._should_collectbefore syncingtests/test_xdist_integration.py(new file)Testing
Backward Compatibility
This change is fully backward compatible:
should_collectparameter defaults toTrue--testmon-nocollectis not usedChecklist