rspec Bisect无限期运行 [英] rspec Bisect Runs Indefinitely

查看:110
本文介绍了rspec Bisect无限期运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在circleci上运行时,我发现有关rspec --bisect的某些意外行为.通常,二等分会无限期运行,直到5小时后超时.二分法最初似乎可以正常工作,但是一旦达到预期的结果,它将开始以相反的方向缓慢地检查子集,直到超时为止.

I'm seeing some unexpected behavior regarding rspec --bisect when running on circleci. Often times the bisect runs indefinitely until it times out after 5 hours. Bisecting appears to be working initially, but once it reaches the expected end, it begins to slowly examine subsets in the opposite direction until it times out.

我的环境:
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

My Env:
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如此行为的原因是什么? 谢谢!

Any idea what causes bisect to behave this way? Thanks!

推荐答案

关于如何继续,我可以为您提供一些指导:

I can have some pointers for you on how to continue:

首先-在任何时候您都可以Ctr-C该过程,并且rspec将输出一个最小的命令以进行重现(希望它的大小比{all_specs}小.

First of all - at any point you can Ctr-C the process and rspec will output the so-far-minimal command to reproduce (hopefully it'll be smaller set that the {all_specs}.

您应该在超时之前尝试一下.有可能检查的可能组合数量如此之大,以至于只是超时(例如,如果有更多时间,它将成功).然后使用此最小命令再次运行--bisect.

You should try this before it times out. There's a chance that the number of possible combinations to check is so big it just times out (e.g. it would succeed if it had more time). Then use this minimal command to run --bisect again.

您也可以尝试--bisect=verbose以便更好地了解幕后情况.

You can also try --bisect=verbose to get a better understanding of what is going on behind the scenes.

您的整个套房似乎都很快(〜2分钟),所以它超时很奇怪.仅以该特定顺序运行整个套件时,才有(无限小的)机会失败.如果是这样的话-您基本上注定要失败.

Your whole suite seems to be pretty fast (~2 minutes) so it's weird it times out. There's (infinitely small) chance that the failure is only when running the whole suite in that particular order. If that's the case - you're basically doomed.

这篇关于rspec Bisect无限期运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆