在circleci上运行时,我发现有关rspec --bisect
的某些意外行为。通常,二等分会无限期运行,直到5小时后超时。二分法最初似乎可以正常工作,但是一旦达到预期的结果,它将开始以相反的方向慢慢检查子集,直到超时为止。
我的环境:
Ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
RSpec 3.7
- rspec-core 3.7.1
- rspec-expectations 3.7.0
- rspec-mocks 3.7.0
- rspec-rails 3.7.2
- rspec-support 3.7.1
命令:
DISABLE_SPRING=true RAILS_ENV=test bundle exec rspec #{all_specs} --order rand:21237 --bisect
Running suite to find failures... (1 minute 5.94 seconds)
Starting bisect with 1 failing example and 424 non-failing examples.
Checking that failure(s) are order-dependent... failure appears to be order-dependent
Round 1: bisecting over non-failing examples 1-424 .. multiple culprits detected - splitting candidates (1 minute 26.35 seconds)
Round 2: bisecting over non-failing examples 1-212 .. multiple culprits detected - splitting candidates (1 minute 29.08 seconds)
Round 3: bisecting over non-failing examples 1-106 .. multiple culprits detected - splitting candidates (1 minute 26.57 seconds)
Round 4: bisecting over non-failing examples 1-53 .. multiple culprits detected - splitting candidates (1 minute 23.85 seconds)
Round 5: bisecting over non-failing examples 1-27 .. multiple culprits detected - splitting candidates (1 minute 29.03 seconds)
Round 6: bisecting over non-failing examples 1-14 .. multiple culprits detected - splitting candidates (1 minute 21.54 seconds)
Round 7: bisecting over non-failing examples 1-7 .. multiple culprits detected - splitting candidates (1 minute 28 seconds)
Round 8: bisecting over non-failing examples 1-4 .. multiple culprits detected - splitting candidates (1 minute 30.43 seconds)
Round 9: bisecting over non-failing examples 1-2 .. multiple culprits detected - splitting candidates (1 minute 28.99 seconds)
Round 10: bisecting over non-failing examples 3-4 .. multiple culprits detected - splitting candidates (1 minute 26.5 seconds)
Round 11: bisecting over non-failing examples 5-7 .. multiple culprits detected - splitting candidates (1 minute 54.99 seconds)
Round 12: bisecting over non-failing examples 5-6 .. multiple culprits detected - splitting candidates (1 minute 42.05 seconds)
Round 13: bisecting over non-failing examples 8-14 .. multiple culprits detected - splitting candidates (1 minute 46.97 seconds)
Round 14: bisecting over non-failing examples 8-11 .. multiple culprits detected - splitting candidates (1 minute 38.02 seconds)
Round 15: bisecting over non-failing examples 8-9 .. multiple culprits detected - splitting candidates (1 minute 35.84 seconds)
Round 16: bisecting over non-failing examples 10-11 .. multiple culprits detected - splitting candidates (1 minute 23.13 seconds)
Round 17: bisecting over non-failing examples 12-14 .. multiple culprits detected - splitting candidates (1 minute 23.11 seconds)
Round 18: bisecting over non-failing examples 12-13 .. multiple culprits detected - splitting candidates (1 minute 36.75 seconds)
Round 19: bisecting over non-failing examples 15-27 .. multiple culprits detected - splitting candidates (1 minute 29.76 seconds)
Round 20: bisecting over non-failing examples 15-21 .. multiple culprits detected - splitting candidates (1 minute 39.97 seconds)
Round 21: bisecting over non-failing examples 15-18 .. multiple culprits detected - splitting candidates (1 minute 35.21 seconds)
Round 23: bisecting over non-failing examples 17-18 .. multiple culprits detected - splitting candidates (1 minute 29.7 seconds)
Round 24: bisecting over non-failing examples 19-21 .. multiple culprits detected - splitting candidates (1 minute 29.41 seconds)
Round 25: bisecting over non-failing examples 19-20 .. multiple culprits detected - splitting candidates (1 minute 31.41 seconds)
Round 26: bisecting over non-failing examples 22-27 .. multiple culprits detected - splitting candidates (1 minute 25.67 seconds)
...
Round 183: bisecting over non-failing examples 181-186 .. multiple culprits detected - splitting candidates (1 minute 58.92 seconds)
Round 184: bisecting over non-failing examples 181-183 .. multiple culprits detected - splitting candidates (1 minute 44.64 seconds)
Build timed out after 5h0m0s
任何想法导致bisect如此行为的原因是什么? 谢谢!
答案 0 :(得分:4)
关于如何继续,我可以为您提供一些指导:
首先-在任何时候您都可以Ctr-C
进行该过程,rspec
将输出一个最小的命令来进行重现(希望它的大小比{all_specs}小)。
您应该在超时之前尝试一下。有可能检查的可能组合数量如此之大,以至于只是超时(例如,如果有更多时间,它将成功)。然后使用此最小命令再次运行--bisect
。
您也可以尝试--bisect=verbose
来更好地了解幕后情况。
您的整个套房似乎都很快(〜2分钟),所以它超时很奇怪。仅以特定顺序运行整个套件时,失败的可能性很小(无限小)。如果是这样,您基本上就注定了。
答案 1 :(得分:1)
对我来说,问题是--bisect
似乎对使用spring无效。即使冗长,它也不会提供有用的输出。我的测试套件应该已经运行了10秒钟。