From ff34e8f310d5df27d2f44de2c09e73140500733e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 22 Jul 2026 21:18:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20Integration=20Tests=20xdist=E9=99=90?= =?UTF-8?q?=E5=88=B6=E6=9C=80=E5=A4=9A4=E4=B8=AAworker=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2DooD=E6=A8=A1=E5=BC=8F=E4=B8=8BOOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/run_integration_tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ci/run_integration_tests.sh b/scripts/ci/run_integration_tests.sh index c54cb0aa3..49aa82ad8 100755 --- a/scripts/ci/run_integration_tests.sh +++ b/scripts/ci/run_integration_tests.sh @@ -253,13 +253,13 @@ echo "=== 运行集成测试(pytest-xdist 并行模式) ===" echo "CPU 核数: $(nproc 2>/dev/null || echo 'unknown')" # 集成测试使用 pytest-xdist 并行加速(coverage 由单元测试负责,并行模式下 coverage 不稳定) -# -n auto: 自动使用 CPU 核数 +# -n auto: 自动使用 CPU 核数(DooD模式下加--maxprocesses=4防止OOM # --dist loadfile: 同一测试文件分配到同一 worker(共享 fixture 更高效) # --maxfail=1: 遇到失败停止调度新测试(并行模式下等价于 -x) PYTHONPATH="$PWD/apps/api:$PWD" python3 -m pytest tests/integration \ -q --timeout=60 --maxfail=1 --reruns 3 --reruns-delay 5 \ -m "not performance" \ - -n auto --dist loadfile \ + -n auto --maxprocesses=4 --dist loadfile \ -p no:cacheprovider echo "✅ 集成测试通过"