After large tests, new changes to files are not picked up for ~45-90 seconds, or not at all. #246

Closed
edslocomb opened this Issue Jan 19, 2014 · 10 comments

Comments

Projects
None yet
3 participants

This does not appear to be caused by lack of support for readline. I've rebuilt ruby and all gems with ruby_configure_flags=--with-readline-dir=/usr/local/opt/readline in ~/.rvm/user/db

This does not appear to be caused by a very large number of files in the project. I do have a very large number of files in public/, but those are ignored, and I moved that directory out of the project root while testing this.

This is not triggered by smaller files that run, say, a dozen tests and finish quickly. I only see it when changing a file results in running more than 50+ or so tests, taking 20 seconds or more.

From my testing so far, this issue first appears in guard-rspec >= 4.0 (guard >= 2.0). 3.1.0 (guard 1.8.2, listen 1.3.1) works fine.

running with --debug does not yield anything useful, just dozens of stopped-interactive /stty commands/started-interactive messages.

my Guardfile while testing:

def all_usage                                                                                                                                                 
  "\nTo run all tests, use \"zeus parallel_rspec spec\" in a terminal window.  aliases:\n  'zpt spec' - run all in parallel\n  'tdb' - rebuild parallel test \
dbs\n\nguard-rspec would add the following options here, which are not compatible with parallel_tests:\n  "                                                   
end                                                                                                                                                           

#3.1.0 syntax (works):
#guard :rspec, zeus: true, bundler: false, all_on_start: false, all_after_pass: false do   

guard :rspec, cmd: 'zeus rspec', run_all: {cmd: "echo \"#{all_usage}\""} do                                                                                  

  ignore(/\/?\.\#/)                                                                                                                                           
  ignore(/public\//)                                                                                                                                          

  watch(%r{^spec/.+_spec\.rb$})                                                                                             
end

OSX 10.9.1 / ruby 2.0.0-p247 / rails 3.2.16

Owner

thibaudgg commented Jan 20, 2014

Do you have a large amount of files in your app? Try to ignore files that don't need to be listened: https://github.com/guard/guard#ignore

Did you read the issue report? Quoted from the description:

This does not appear to be caused by a very large number of files in the project. I do have a very large number of files in public/, but those are ignored, and I moved that directory out of the project root while testing this.

As you can clearly see in the Guardfile I provided, I am aware of and using the ignore() function. And as I stated, I moved excess files out of the project root while testing.

Owner

thibaudgg commented Jan 20, 2014

Oops sorry, read too fast.

I see that you're using Zeus, have you try without it?

I'll test it for you and report back. Zeus does work perfectly with guard-rspec v3.1.0. As stated in the report.

Member

907th commented Jan 20, 2014

@thibaudgg What's the issue with large amount of files in app?

The answer is no, running without zeus does not address this issue.

In fact, it's slightly worse; we've got some performance testing set up with Test::Unit in test/, which guard-rspec of course shouldn't care about at all, yet guard-rspec is reporting

invalid option: -f
Test::Unit automatic runner.

[and a long usage message]

and there's still a long (45-120 second) delay between running a long (see previous comments) test and guard-rspec picking up a file change.

The relevant line in the Guardfile for this test is:

guard :rspec, run_all: {cmd: "echo \"#{all_usage}\""} do
Owner

thibaudgg commented Jan 20, 2014

@907th Listen use in memory all files md5 checksum (eager loaded when modified).

@907th we've got over 1,400,000 media files in public/, that's going to put a fair bit of strain on most file-monitoring systems.

But as I've said, I've got that directory ignore()d, and I've moved it out of the project root for testing.

Owner

thibaudgg commented Apr 28, 2014

@edslocomb could you try with Listen 2.7.3, thanks!

Apologies for the delay, I was on vacation last week.

We're in the process of migrating to rails 4 for the affected app; in that project branch Listen 2.7.1 appears to be working correctly. We've bumped so many gems for that, and altered so much code, that I'm afraid it would be completely impractical to determine which change specifically fixed the problem.

But it does seem to work now, and that's all I care about, so I'll close this.

@edslocomb edslocomb closed this May 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment