You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix ReAwaitable concurrent await race condition and enhance test coverage
This commit resolves the race condition in concurrent await scenarios and
adds comprehensive multi-framework async support with enhanced test coverage.
## Key Changes:
**ReAwaitable Enhancements:**
- Resolve race condition in concurrent await scenarios by properly handling asyncio locks and coroutine state management
- Add full support for trio and anyio async frameworks beyond asyncio
- Implement intelligent framework detection with graceful fallbacks (asyncio → trio → anyio → threading)
- Add comprehensive DEBUG-level logging for lock fallback scenarios to aid troubleshooting
- Achieve thread-safe concurrent await support across all major Python async frameworks
- Refactor implementation to reduce complexity and improve maintainability
**Test Infrastructure:**
- Achieve 100% branch coverage with comprehensive test cases
- Add extensive tests for all framework scenarios and edge cases
- Add comprehensive tests for logging functionality across all framework scenarios
- Refactor tests into focused helper functions for better maintainability
- Add safe private attribute access helpers to improve test reliability
- Enable pytest-asyncio auto mode for better test infrastructure
**CI/Build Improvements:**
- Update CI workflow to use correct Poetry installation path (.local/bin)
- Fix mypy plugin compatibility and test infrastructure for CI
- Add pytest-asyncio dependency for async test support
**Documentation:**
- Update documentation to reflect enhanced framework compatibility
- Add detailed docstring documenting framework precedence order
- Add changelog entry for the bug fix
This addresses issue #2108 where trio/anyio users experienced
"coroutine is being awaited already" errors with concurrent awaits.
The implementation now provides thread-safe concurrent await support
across all major Python async frameworks.
0 commit comments