[gevent worker] prevent late monkey-patching in pytest - #468
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe changes prevent late gevent monkey-patching during plain pytest collection. Session finalization now uses the launch-time socket-patching state. New subprocess tests verify successful collection for representative modules. ChangesGevent collection behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR prevents late gevent monkey-patching in plain pytest while preserving the pre-patched worker path; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant RegressionTest
participant ChildPython
participant Pytest
participant TestModules
RegressionTest->>ChildPython: Run pytest --collect-only
ChildPython->>Pytest: Collect representative test module
Pytest->>TestModules: Import test configuration
TestModules-->>Pytest: Patch gevent only if socket is already patched
Pytest-->>RegressionTest: Return collection status and output
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
julietshen
left a comment
There was a problem hiding this comment.
LGTM, tiny nit on a false green if there are zero tests
| # markers must be absent, and a healthy run reports the collected count | ||
| assert 'cannot release un-acquired lock' not in combined, combined | ||
| assert 'error during collection' not in combined, combined | ||
| assert 'collected in' in result.stdout, result.stdout |
There was a problem hiding this comment.
i think this will also say this if it's empty, no?
🤖 summary
prevents gevent test modules from monkey-patching an already-running plain pytest process, while preserving the gevent worker's pre-patched integration runner and forced-exit workaround
related issues/tasks
changes made (˶ᵔ ᵕ ᵔ˶)
gevent.monkey.patch_all()after plain pytest has startedmodels used
testing
Summary by CodeRabbit
Bug Fixes
Tests