I'm curious if there is something I am doing wrong, or if the change to using 0.0.0.0 in #88 is causing other people problems as well.
Issue
I have an application that has been using pact tests for some time. The tests haven't changed between version 2.7.1 and 2.8.0, but I'm now receiving the following error when running rspec tests locally (on OS X):
RuntimeError:
Rack application timed out during boot
If it's of interest, the mock_service definition that relates to the timeout is very simple, and looks similar to this:
When investigating the timeout, I noticed that the only change between 2.7.1 and 2.8.0 was #88, which added the Host: '0.0.0.0' option to webrick_opts. In addition, the host method in lib/pact/consumer/server.rb is still returning "localhost".
Specifically, it looks like the boot timeout ultimately relies on get_identity -- which creates a new Net::HTTP request with the value of host -- and that localhost and 0.0.0.0 are potentially incongruent.
Changing the return value of the host method to "0.0.0.0" and running the tests again exposed that lib/pact/mock_service/client.rb lines 11 and 44 also needed to be changed from localhost to 0.0.0.0.
At that point, our tests were failing because of our own hard-coded references to http://localhost (with the appropriate port for the related mock server), but after changing these values to 0.0.0.0, all tests pass as they had with version 2.7.1.
For now, we're going to pin pact-mock_service to 2.7.1, but I'm curious if anyone has any ideas!
Sorry, I'll revert that change and put out a new release. We'll work out another way of achieving what was trying to be achieved with the PR that changed it to 0.0.0.0.
I'm curious if there is something I am doing wrong, or if the change to using
0.0.0.0
in #88 is causing other people problems as well.Issue
I have an application that has been using pact tests for some time. The tests haven't changed between version 2.7.1 and 2.8.0, but I'm now receiving the following error when running
rspec
tests locally (on OS X):If it's of interest, the
mock_service
definition that relates to the timeout is very simple, and looks similar to this:My /etc/hosts file seems sensible as well:
Investigation
When investigating the timeout, I noticed that the only change between 2.7.1 and 2.8.0 was #88, which added the
Host: '0.0.0.0'
option towebrick_opts
. In addition, thehost
method inlib/pact/consumer/server.rb
is still returning"localhost"
.Specifically, it looks like the
boot
timeout ultimately relies onget_identity
-- which creates a newNet::HTTP
request with the value ofhost
-- and thatlocalhost
and0.0.0.0
are potentially incongruent.Changing the return value of the
host
method to"0.0.0.0"
and running the tests again exposed thatlib/pact/mock_service/client.rb
lines 11 and 44 also needed to be changed fromlocalhost
to0.0.0.0
.At that point, our tests were failing because of our own hard-coded references to
http://localhost
(with the appropriate port for the related mock server), but after changing these values to0.0.0.0
, all tests pass as they had with version 2.7.1.For now, we're going to pin
pact-mock_service
to 2.7.1, but I'm curious if anyone has any ideas!