3

I have jRuby on Rails application with some cucumber tests.

Problem is that cucumber features hangs after executing all steps until I press ctrl+c. Interesting that it only happens if all of the tests pass.

10 scenarios (10 passed)
116 steps (116 passed)
13m59.058s
-> hangs here

I've tried adding global at_exit hook, it is being executed and than command freezes.

Here is my bundle list https://gist.github.com/37f2448055071bbbc636

My temporary solution is to add at_exit hook like this

at_exit do 
  exit! !($!.nil? || $!.is_a?(SystemExit) && $!.success?)
end

Some connections may be left opened, data not cleaned, etc. but it will at least exit with correct status code, which is used by CI server.

tomgi
  • 1,422
  • 11
  • 20

2 Answers2

1

I realize this is a very old post, but in case anyone stumbles upon this, per:

https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md#exiting

if you add --exit after your cucumber command, cucumber will exit when the test are finished. This is what worked for me at least.

Seth Wheeler
  • 353
  • 1
  • 2
  • 16
0

In our case, we realized that this lock-up happens when we created background processes that weren't quitting properly. We fixed this be replacing system() calls with spawn() ones, and killing any child processes in our at_exit hook.

KurtPreston
  • 1,062
  • 14
  • 28