【问题标题】:RSpec bisect runs indefinetlyRSpec bisect 无限期运行
【发布时间】:2019-12-20 12:55:47
【问题描述】:

这个问题和这个不一样:rspec Bisect Runs Indefinitely

我的测试套件需要 ± 10 分钟才能运行。 当我运行bundle exec rspec --bisect=verbose 时,它被卡住了1个多小时(这是我等待的最长时间):

bundle exec rspec --bisect=verbose
AssetSync: using /home/belasis/dev/deploy_webapp/config/initializers/asset_sync.rb
Bisect started using options: "" and bisect runner: :fork
Running suite to find failures...

在我按下 Ctrl C 后,出现这条消息:

Bisect aborted!

The most minimal reproduction command discovered so far is:
  (Not yet enough information to provide any repro command)

所以,问题是它什么也没运行,也没有给出错误信息。这怎么可能?

【问题讨论】:

标签: rspec rspec-rails rspec3


【解决方案1】:

我遇到了这个问题,我通过 3 个操作解决了这个问题。我认为这是最后一个有帮助的,但在某些情况下其他可能也很重要:

  1. rspec-core更新到3.9.1版本
  2. 使用 DISABLE_SPRING=true 环境变量运行平分
  3. 使用shell bisect_runner 而不是默认的fork one

最后的更改是通过创建一个具有如下配置的本地文件来实现的:

RSpec.configure do |config|
  config.bisect_runner = :shell
end

让我们称之为 rsp_shell.rb 并将其保存在项目根目录中。

然后你必须像这样运行 bisect:

bundle exec rspec --require './rsp_shell' --bisect=verbose ...other arguments...

此外,在命令中将 require 参数放在 bisect 参数之前似乎很重要。

表示应用的最后一个设置将是 rspec 输出中的以下字符串:

and bisect runner: :shell

【讨论】:

    【解决方案2】:

    我不时遇到这种情况,有时唯一可行的解​​决方法是尝试不同的 RSpec 版本。

    尝试降级/升级它(如果你使用 bunlder 应该很容易)并尝试直到它工作或你失去希望。

    但是,如果您找到更好的解决方法,甚至是真正的解决方案,请务必分享 :)

    【讨论】:

      【解决方案3】:

      这是一个错误,它一直是recently fixed。它还没有发布,所以你必须使用master 分支。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-07-26
        • 2019-02-04
        • 2023-01-12
        • 2013-02-02
        • 2017-05-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多