Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cucumber tests fails to start with error "Display socket is taken but lock file is missing.."

After running cucumber

bundle exec cucumber features/emails.feature:20

I am getting error

Display socket is taken but lock file is missing - check the Headless troubleshooting guide (Headless::Exception) /Users/me/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/headless-2.2.0/lib/headless.rb:195:in ensure_xvfb_is_running' /Users/me/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/headless-2.2.0/lib/headless.rb:184:in launch_xvfb' /Users/me/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/headless-2.2.0/lib/headless.rb:172:in `block in pick_available_display'

I am running MacOS 10.11.5, xquartz installed, test started first time and I cant make it to start again. Any suggestions?

like image 604
Kano Avatar asked Jul 25 '16 09:07

Kano


1 Answers

Full disclosure: I have no idea what is happening here, and would love for someone to explain it to me, but running the following commands gets Xvfb and my test suite working correctly:

mkdir /tmp/.X11-unix
sudo chmod 1777 /tmp/.X11-unix
sudo chown root /tmp/.X11-unix/

I found this answer here: https://github.com/leonid-shevtsov/headless/issues/47 (first comment)

like image 100
jj57347 Avatar answered Sep 22 '22 22:09

jj57347