【问题标题】:How can I install something on Travis CI without a timeout?如何在没有超时的情况下在 Travis CI 上安装一些东西?
【发布时间】:2015-04-29 01:00:42
【问题描述】:

我正在尝试在 travis-ci.org 上测试一个包构建,但我遇到了 pip install scipy 超时:

Installing collected packages: scipy
  Running setup.py install for scipy
    Running command /home/travis/virtualenv/python2.6.9/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Fn2gmJ/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hWDx9L-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/virtualenv/python2.6.9/include/site/python2.6


No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.

The build has been terminated

(摘自最近的build log)。

如何在 Travis 上构建 scipy >= 0.11 而不会超时?

【问题讨论】:

标签: scipy continuous-integration travis-ci


【解决方案1】:

Travis 上每个命令的默认超时时间是 10 分钟,当您仅使用函数 travis_wait 时,超时时间是 20 分钟。如果您的构建需要等待超过 20 分钟,您可以传递几分钟的时间来函数 travis_wait,例如:

$ travis_wait 30 pip install scipy

这是 Travis 中未记录的功能,但 Travis 的 Hiro Asari 在github issue 上建议使用它。

【讨论】:

    【解决方案2】:

    解决方案很简单。只需在安装命令前加上 travis_wait。更多详情请访问https://docs.travis-ci.com/user/common-build-problems

    【讨论】:

      【解决方案3】:

      如果不能使用Travis CI 提供的travis_wait 等命令,您也可以使用an approach from here

      在我的情况下,我想保持 Travis 运行,同时在单独的 shell 脚本中定义步骤,我不知道如何使用 Travis 提供的命令。上面的方法效果很好(如果有兴趣,请参阅the pull request)。

      【讨论】:

        猜你喜欢
        • 2017-05-19
        • 2015-06-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-03
        • 1970-01-01
        • 1970-01-01
        • 2021-06-23
        相关资源
        最近更新 更多