python - Github Actions 停留在一个任务上,最后超时失败
问题描述
对于破裂python 包,我们使用 Github Actions 在每个应该合并的 PR 上运行我们的测试master
。到目前为止,它工作得很好。但是几天以来,这个 Gh Actions 一直卡住并最终在超时(360 分钟)时失败。
请在此处找到特定运行中的症状示例。
请在此处找到执行测试的 Gh Actions 代码。它有strategy matrix
几个 python 版本和操作系统。
name: Run tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- os: windows-latest
python-version: 3.9
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install ruptures
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with pytest
run: |
python -m pytest
据我所见,没有错误,只是卡住了。据我所知,它始终停留在strategy matrix
组合的第一个元素上,即对我们来说它是 python v3.6(这是矩阵可能性中最低的)。但同样,不确定它是否与此相关,因为没有错误,只是超时,没有关于出现问题的具体消息(除非我没有找到正确的地方)。
matrix
由于我认为这可能与 Ghmax-parallel: 2
在strategy
. 但这并没有解决任何问题。
出于同样的原因,我尝试从strategy matrix
python v3.6 中删除,以查看 python v3.6 是否是特定问题。但它不能解决任何问题,Gh Actions 只是停留在 Python v3.7 而不是 v3.6 上。请参阅此处以查看运行情况。
测试在本地顺利运行。
我不明白是什么导致了这种行为,更何况这个 Gh Actions 过去几个月都没有任何问题。
解决方案
感谢jidicula,我能够调查并找到解决方案。
底线:
- 它与 Github Actions 无关
- 它完全与
pip
解决方案:
而不是升级pip
使用python -m pip install --upgrade pip
,手动将版本设置为最后的工作版本python -m pip install pip==21.0.1
。详细说明:
- 在我们的特殊情况下,升级 pip 会给
v21.1
出版本 pip
允许 Gh Actions 顺利运行的最后一个版本是v21.0.1
. 所以我现在手动设置pip
为这个特定的值
说明:
v21.1
新的 ( )pip
版本似乎有问题
在失败的 Gh Actions中,有以下消息:
Processing /home/runner/work/ruptures/ruptures
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behaviour before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
然而,一旦pip
升级到v21.1
,添加或不添加--use-feature=in-tree-build
并没有解决任何问题,pip
只是卡住了。
也与--use-feature=in-tree-build
我在repo上找到了这个问题有关。pip
这最后一期有一个评论建议做
python setup.py bdist_wheel
pip install dist/*.whl
而不是pip install .
在我们的特定情况下不是一个好的解决方案,因为我们正在利用指定[options.extras_require]
类似的可能性python -m pip install .[test]
。但这可能对您有所帮助!
最后,有关 中潜在错误的更多详细信息pip
,请在此处找到对几个相关行为进行分组的问题。
推荐阅读
- python - 为什么我收到 OSError:[WinError 193] %1 不是有效的 Win32 应用程序
- fabricjs - SVG背景没有在fabricjs中填充画布
- docusignapi - 演示 Docusign Connect 通知“已发送”不起作用
- go - 从 URL 查询参数解码 JSON
- node.js - 在 Express Nodejs 中记录用户活动
- angular - Angular Slickgrid - 基于网格数据加载单选编辑器集合
- java - Java 8 2 个不同列表的比较
- mule - Dataweave 2.0 中的 Excel 到 Json 映射
- mysql - SQL:检测多个相同的条目作为一个批次
- marklogic - 当任务服务器负载不足时,减少延迟或优先处理应用服务器 (XDBC/HTTP) 上的传入请求