6

In a rails application I'm developing (on OS-X), I'm finding running the test suite via rspec locking up increasingly frequently. It does not happen every time. I've tried adding --format documentation when running the suite to see if it happens at the same place every time, and it does not.

I've tried killing the process with kill -9. It then changes the name to (ruby) with a process status of ?E. This link suggests that the process is blocked waiting for a system call to finish. I have to restart my machine every time this happens in order to kill this process.

I've tried re-installing rvm, ruby, mysql, and imagemagick. This project is using imagemagick (via the mini_magick) gem, and I suspected that it may be one of these commands that is causing rspec to block. I tried adding puts statements around each of the mini_magick commands to ensure they finish executing, and all looks fine.

I'm looking for suggestions on how to diagnose this issue.

Community
  • 1
  • 1
MAckerman
  • 408
  • 1
  • 6
  • 15
  • Use the `-e` switch to only run certain specs based on the pattern you give it. Run `rspec -h` for more info. – ian Mar 15 '13 at 00:51
  • The problem doesn't seem to happen when running individual specs or a small subset of specs (single file), but rather when running the entire test suite. I'm looking for a way to debug what the process is blocked on? – MAckerman Mar 15 '13 at 14:58
  • I think you'll need to post at least some of your specs, at least then it's possible to get an idea of what they're trying to do. Also, check that your specs aren't running in a random order. If you used RSpec to generate the spec_helper file then it adds random ordering as a default. – ian Mar 15 '13 at 16:12
  • Can you explain why random ordering would have an effect on this? – MAckerman Mar 15 '13 at 17:39
  • You said it didn't happen in the same place. Maybe it does, but the specs aren't being run in the order you expect. The "--format documentation" output [is not a guarantee of the order](https://github.com/rspec/rspec-core/issues/635#issuecomment-6308617). – ian Mar 15 '13 at 19:29

1 Answers1

0

It's possible your problem is an order-dependency bug, you can pass the seed along and the order will remain consistent. RSpec prints out the random number it used to seed the randomizer. Use this number to run rspec with the same order --order rand:3455

XavM
  • 863
  • 9
  • 22