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 "✅ 集成测试通过"