ewollesen / autotest-inotify

Teaches autotest to use inotify (on Linux) instead of filesystem polling.
http://kill-0.com/projects/autotest-inotify
MIT License
18 stars 7 forks source link

Warnings caused; autotest no longer responds to interrupt <ctrl-c> to stop. #8

Open cosmolee opened 13 years ago

cosmolee commented 13 years ago

Ubuntu 10.04, Rails 3.0.3

After a new install of autotest-inotify, autotest prints warnings which appear to be caused by autotest-inotify and rb-inotify.

When using autotest-inotify (require 'autotest/inotify' in .autotest file), autotest will no longer exit by typing twice. Must use kill -9 to stop process.

$ autotest
loading autotest/rails_rspec2
/home/tutorial/.rvm/gems/ruby-1.9.2-p0@test-set03/gems/rb-inotify-0.8.4/lib/rb-inotify/notifier.rb:251: warning: shadowing outer local variable - ev
/home/tutorial/.rvm/gems/ruby-1.9.2-p0@test-set03/gems/autotest-inotify-0.0.4/lib/autotest/inotify.rb:64: warning: instance variable @notifier not initialized

$ gem list
...
autotest (4.4.5)
autotest-inotify (0.0.4)
autotest-rails-pure (4.1.2)
rb-inotify (0.8.4, 0.8.3)
ZenTest (4.4.2)

I do not know how to test if autotest-inotify is working despite the autotest warnings, so I can't say if it is nevertheless functional (?)...

cosmolee commented 13 years ago

I forgot to detail the problem of autotest not responding to interrupt signals when running with autotest-inotify.

Normally, one hits twice to exit autotest. But when running with autotest-inotify, autotest doesn't respond to the interrupt signals. It just to hangs.

I've figured out that in order to get autotest to exit, I must open up another terminal, go somewhere in the rails project hierarchy that autotest is running in, and then generate some kind of file system activity. Something as simple as running ls on a directory or opening or saving a file will do the trick. Until then, autotest just sits there and ignores the interrupt signals.

ewollesen commented 13 years ago

When I run with ruby 1.8.7 and rails 3.0.3 on Ubuntu 10.04, I'm seeing some different issues. I'll get working on what I'm seeing, and see if I can't use some rvm magic to test ruby 1.9.2.

With the above config, I am able to press ^C twice to exit, however changing a model causes autotest to encounter some sort of error, and tests are not run.

Of the two warnings you're seeing, I see the second in 1.8.7, but not the first, so will try and resolve those as well.

outoftime commented 13 years ago

I'm having that problem with 1.9.2 as well; autotest also stops responding to changes in tests after the first time, usually. ps shows it waiting on inotify, which makes some sense.

kimhyunkang commented 13 years ago

I'm having this issue, too. I'm using Ubuntu 10.10, Ruby 1.9.2. Strangely, when I straced into the process to see what's happening, the process suddenly seemed to get back to normal behaviour and printed the message "Interrupt a second time to quit" Below is the system call trace, after sending Ctrl-C twice.

$ sudo strace -p 6651

Process 6651 attached - interrupt to quit write(1, "Interrupt a second time to quit", 31) = 31 write(1, "\n", 1) = 1 time(NULL) = 1298510615 clock_gettime(CLOCK_MONOTONIC, {236406, 686670703}) = 0 gettimeofday({1298510615, 212546}, NULL) = 0 clock_gettime(CLOCK_REALTIME, {1298510615, 212619504}) = 0 futex(0xa066778, FUTEX_WAIT_PRIVATE, 3, {1, 499926496}) = 0 futex(0xa0667c0, FUTEX_WAKE_PRIVATE, 1) = 0 clock_gettime(CLOCK_MONOTONIC, {236406, 693579228}) = 0 gettimeofday({1298510615, 219482}, NULL) = 0 clock_gettime(CLOCK_REALTIME, {1298510615, 220118465}) = 0 futex(0xa066778, FUTEX_WAIT_PRIVATE, 5, {1, 492454535}) = -1 ETIMEDOUT (Connection timed out) futex(0xa0667c0, FUTEX_WAKE_PRIVATE, 1) = 0 clock_gettime(CLOCK_MONOTONIC, {236408, 187209735}) = 0 time(NULL) = 1298510616 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 futex(0x8219b84, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x8219b80, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1 futex(0x8219b60, FUTEX_WAKE_PRIVATE, 1) = 1 rt_sigaction(SIGINT, {SIG_IGN, [], SA_SIGINFO}, {0x80f0710, [], SA_SIGINFO}, 8) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_SIGINFO}, {SIG_IGN, [], SA_SIGINFO}, 8) = 0 munmap(0xb72e7000, 528384) = 0 exit_group(0) = ? Process 6651 detached

and my environments

autotest (4.4.6) autotest-inotify (0.0.5) rb-inotify (0.8.4) ZenTest (4.5.0)

hjdivad commented 13 years ago

For what it's worth, I was having this problem with versions 0.0.2..0.0.4, but am no longer seeing this in 0.0.5.

cosmolee commented 13 years ago

V 0.0.5? Isn't the current version 0.0.4? I'm a GIT newbie, but I don't see a V 0.0.5 on the branch list. How does one tell what versions are available?

hjdivad commented 13 years ago

I don't see a v0.0.5 tag or branch either. However, VERSION in master is bumped to v0.0.5, and this seems to be released to rubygems.org[1].

[1] http://rubygems.org/gems/autotest-inotify

cosmolee commented 13 years ago

I tried version 0.0.5. This did not fix the problem for me. is still ignored until I make a change to a monitored file.

$ autotest loading autotest/rails_rspec2 /home/cosmo/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/ffi-1.0.4/lib/ffi/struct.rb:225: warning: method redefined; discarding old align /home/cosmo/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/ffi-1.0.4/lib/ffi/struct.rb:126: warning: previous definition of align was here /home/cosmo/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/rb-inotify-0.8.4/lib/rb-inotify/notifier.rb:251: warning: shadowing outer local variable - ev


bundle exec /home/cosmo/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -S /home/cosmo/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/rspec-core-2.3.1/bin/rspec --tty '/home/cosmo/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb' '/home/cosmo/rails_projects/sample_app/spec/controllers/sessions_controller_spec.rb' '/home/cosmo/rails_projects/sample_app/spec/controllers/users_controller_spec.rb' '/home/cosmo/rails_projects/sample_app/spec/models/user_spec.rb' '/home/cosmo/rails_projects/sample_app/spec/requests/layout_links_spec.rb' '/home/cosmo/rails_projects/sample_app/spec/requests/users_spec.rb' ............................................................

Finished in 3.11 seconds 60 examples, 0 failures

Waiting since 2011-05-20 08:32:31


/home/cosmo/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/autotest-growl-0.2.9/lib/autotest/growl.rb:112: warning: instance variable @last_modified not initialized

Waiting since 2011-05-20 08:32:31

^C^C^C^CInterrupt a second time to quit

(Autotest only exited after I went and modified a controller file. FYI, the "Interrupt a second time to quit" message doesn't appear until after I modify the file. It's as if something is blocking the signals.)