背景
在 #515 的 SDK 兼容审计期间,全量 ./scripts/doctor.sh 偶发出现 PytestUnhandledThreadExceptionWarning:aiosqlite 的 _connection_worker_thread 尝试通过 call_soon_threadsafe 回调时,pytest event loop 已关闭。
该警告在锁定的 a2a-sdk 1.1.2 与临时安装的上游 v1.1.3 release commit 环境中都观察到,因此不是 SDK 升级或 #514 出站鉴权修改引入。测试本身仍通过。
当前证据
- 环境:Python 3.14.6、aiosqlite 0.22.1。
- 曾在
tests/server/test_transport_contract.py 测试执行附近出现。
- 单独以
-W error::pytest.PytestUnhandledThreadExceptionWarning 重跑相关测试未复现,初步判断为 teardown/lifecycle 时序问题。
建议调查
- 检查 app/database engine fixture 是否等待所有 aiosqlite worker 与 connection 完整关闭。
- 在 Python 3.14 下重复运行 database/transport tests,形成稳定复现。
- 判断是否需要将该 warning 提升为 CI error,避免资源泄漏被测试成功状态掩盖。
验收标准
背景
在 #515 的 SDK 兼容审计期间,全量
./scripts/doctor.sh偶发出现PytestUnhandledThreadExceptionWarning:aiosqlite的_connection_worker_thread尝试通过call_soon_threadsafe回调时,pytest event loop 已关闭。该警告在锁定的
a2a-sdk 1.1.2与临时安装的上游v1.1.3release commit 环境中都观察到,因此不是 SDK 升级或 #514 出站鉴权修改引入。测试本身仍通过。当前证据
tests/server/test_transport_contract.py测试执行附近出现。-W error::pytest.PytestUnhandledThreadExceptionWarning重跑相关测试未复现,初步判断为 teardown/lifecycle 时序问题。建议调查
验收标准
./scripts/doctor.sh通过