-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cucumber 2.x locations_filter slow as hell (unlike 1.3.19) #901
Comments
to make it 2 orders of magnitude faster two things were needed: 1. do not try all locations, only those with matching file name 2. do not order test cases after the fact, put them in proper place from the beginning using matching locations index 3. cache locations lists by file name (this gives little improvement but may help better with even larger number of files) This is achieved by adding a Test::Case method to return index of matching location so we don't need to figure out later which one exactly the matching location was.
to make it 2 orders of magnitude faster two things were needed: 1. do not try all locations, only those with matching file name 2. do not order test cases after the fact, put them in proper place from the beginning using matching locations index 3. cache locations lists by file name (this gives little improvement but may help better with even larger number of files) This is achieved by adding a Test::Case method to return index of matching location so we don't need to figure out later which one exactly the matching location was.
to make it 2 orders of magnitude faster two things were needed: 1. do not try all locations, only those with matching file name 2. do not order test cases after the fact, put them in proper place from the beginning The above also removes duplicates for good or for bad. This is achieved by adding a Test::Case method to return index of matching location so we don't need to figure out later which one exactly the matching location was.
I confirm it to run the test case within cucumber/cucumber-ruby-core#97 has got amazing improvment ! Thanks @akostadinov |
@xuanzhaopeng 👍 I also see the improvement by running with cucumber/cucumber-ruby-core#99 in one of team's suites. |
I believe issue is fixed better upstream now, closing. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I did some more investigation. It seems like with a huge number of locations set on the command line, the location filter is slow as hell. At first it takes a few seconds to process each location and becoming increasingly slower.
I am looking at it by inserting
Kernel.puts("#{location.file}:#{location.line}")
atcucumber/core/test/filters/locations_filter.rb:30
. Can that be done somehow more efficient? Otherwise we are stuck with obsoleted and flaky cucumber 1.3 :/------ Original report ------
We've just hit a bad issue with cucumber 2.x (tested 2.0.0 and 2.0.2). Some of our runs hang forever in seemingly an infinite loop. Other selections do not hang in the same way. It's a huge command line with
file:num
pairs.I'll paste below a couple of backtraces I've obtained with
gdb
. (read backwards to what normally expected). It seems to meCore::Test::Step#match_locations?
might be producing an infinite loop somehow. Any idea or at least debugging suggestions?The third backtrace looks interesting with the method_missing call.
The text was updated successfully, but these errors were encountered: