webrick hangs sometimes with guard-jasmine cli

135 views
Skip to first unread message

Huy Nguyen

unread,
Dec 18, 2011, 8:06:35 PM12/18/11
to guar...@googlegroups.com
I'm having trouble getting guard-jasmine cli working consistently on a jenkins ci server.

When running
`bundle exec guard-jasmine`

```bash
Guard::Jasmine starts Rack test server on port 8888 in development environment.
[2011-12-18 19:14:16] INFO  WEBrick 1.3.1
[2011-12-18 19:14:16] INFO  ruby 1.9.3 (2011-10-30) [x86_64-linux]
[2011-12-18 19:14:16] WARN  TCPServer Error: Address already in use - bind(2)
[2011-12-18 19:14:16] INFO  WEBrick::HTTPServer#start: pid=14343 port=8888
```
It will just hang and never run the spes, the odd thing about it is I can issue requests to the server, via `curl http://localhost:8888` so it's running. Killing it and running it again sometimes the specs will run as expected. Also `guard` by itself will always works and I can't reproduce this on my local env. I tried to trace this a little with put statements in server.rb and it looks like once the Rack/Webrick thread gets to that point it never returns execution to the main thread?


ci server is running ubuntu 11.04

Any ideas would be appreciated.



Gemfile.txt

Michael Kessler

unread,
Dec 19, 2011, 4:01:43 AM12/19/11
to guar...@googlegroups.com
I'm also having some troubles with the server start in guard-jasmine, it seems a bit unstable, but I can't figure out the problem. I just released guard-jasmine, which allows you to use also mongrel or thin as testing server:

guard :jasmine, :server => :thin do
...
end

Now you can test if your issue is related to WEBrick or not.

> <Gemfile.txt>

Huy Nguyen

unread,
Dec 19, 2011, 8:26:36 PM12/19/11
to guar...@googlegroups.com
Swapped it out with thin and got the same result. I'm not sure what it might be, I tried to do a manual sleep instead of checking for server up but as soon as the server thread fires it never comes back. If I have time I'm going to try and rewrite parts of server.rb to match capybara's server.rb to see if makes any difference. 
Reply all
Reply to author
Forward
0 new messages