-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow Pact Mock Server results in timeout #20
Comments
Released a fix, 4.5.2, bit not positive if it will fix the issue. Added a test to add a delay for server initialization. |
Thanks @mboudreau, unfortunately the issue has not been resolved. |
@scrumtech can you please set the log level to debug and post what's shown?
|
|
@scrumtech have you tried not setting up a directory? |
@scrumtech seems to me that the pact binary dies before you even start your tests. Maybe you should try to run the binary directly without going through pact-node with the same options. The binary is available under |
I spoke to Wil on this and as I understand the Pact Binary runs just fine. Looking at those logs, the service comes up at 23:07:24 and shuts down 23 On Wed, Aug 31, 2016 at 10:17 AM, Michel Boudreau notifications@github.com
Matt Fellows |
Hm, right. On the pact-node side, it calls the service to check that it's actually up (there's no other way of knowing). It could be that there's a weird network thing that it can't call pact from the node wrapper. I might have to try this out further, however, I don't want to have to create a vagrant box to replicate. Can this be replicated using Docker? |
I'm working on a Docker setup for you now @mboudreau... standby. |
OK, I've ported it to Docker (still works, sorry), and here is the FROM ubuntu:trusty
RUN mkdir -p /vagrant/.vagrant-config/
RUN mkdir -p /home/vagrant/
COPY . /vagrant
RUN chmod +x /vagrant/.vagrant-config/*.sh
RUN /vagrant/.vagrant-config/provision.sh
RUN /vagrant/.vagrant-config/node_install.sh
WORKDIR /vagrant
RUN npm i
RUN npm t Steps to run the tests:
Additionally, I had to replace the newer version of ruby on line 14 of @scrumtech keen to see if you get the same error on Docker or if it disappears! |
Why did you have to install Ruby? We don't need it for pact-node... On Wed, Aug 31, 2016, 8:47 PM Matt Fellows notifications@github.com wrote:
|
I think it's just part of a default image type thing. As I understand it's In any case, if it is Ruby that's the cause (I'm doubtful as it worked for On Wed, Aug 31, 2016 at 9:18 PM, Michel Boudreau notifications@github.com
Matt Fellows |
This is getting weird and frustrating that we can't reproduce this anywhere... I've seen this for months and only affects certain people. |
@scrumtech can you try the docker version to see if it fails for you? Trying to see what's the 'variable' that's making this fail. |
Will try to get back to you today on this. |
Thanks Will. On Mon, Sep 5, 2016 at 9:43 AM, Will Falconer notifications@github.com
Matt Fellows |
After playing with the docker image at work, I feel that the docker image has been changed so much it isn't a real representation of the issue we are having. Having said that, I quickly span up a docker image based on node:5 and was able to get things working, which has given me an idea to work around this issue for the moment. I'll share my dockerfile or docker-compose.yml when I get it worked out. |
@scrumtech docker should be able to recreate exactly the situation you On Mon, Sep 5, 2016 at 4:42 PM Will Falconer notifications@github.com
|
How can it be - it's a completely different runtime :) I'm glad the docker container worked though. @michel - any chance you might change your mind on the vagrant side of On Mon, Sep 5, 2016 at 4:42 PM, Will Falconer notifications@github.com
Matt Fellows |
@mefellows Vagrant isn't going to help me debug the issue unless I can reproduce the simplest steps possible to make it break. There are many things that could be making it break in vagrant... I have a sinking feeling that there's something weird happening with the network not allowing it to connect to the pact service when it's up. I can give it a shot tonight over vagrant. |
Yeah I totally get your point, we can't rule out Vagrant but there is @will - I'm actually wondering if you could try upping this value from 10s I have a sneaking suspicion it's as simple as that (and maybe a better On Mon, Sep 5, 2016 at 4:51 PM, Michel Boudreau notifications@github.com
Matt Fellows |
I could change the number I suppose, but I don’t even know what pact is :( |
Sorry @will, looks like I accidentally brought you into the convo inadvertently (sent via email). You should read up on Pact though hehe ;) cc: @scrumtech |
@mefellows bahahaha, awesome |
Ok. I have made some progress. Docker the way @mefellows was running it, isn't going to fit into our dev environment (too slow to build a docker image each time), however, it did work. So I have been trying an alternative docker method
This still doesn't work. However, this is not conclusive, since I'm on Windows 7, so I have to run Vagrant in order to run docker (which is why we use Vagrant in the first place). I'm going to suggest that there is actually something interesting going on with the node_modules folder in Vagrant which is causing this problem. This is mainly gut feel at the moment based a little bit on previous problems we have had with node_modules (so I have no proof of this). I also can't rule out @mboudreau's suggestion of a network related issue. I think it is safe to say that the problem is quite related to Vagrant. |
@mefellows I tried changing that timeout to 30 seconds , and no difference. |
I was thinking more about the issue this morning. From the testing we have done so far I think we can say the following
Vagrant is definitely the critical bit of information here. So we must be testing in Vagrant. I'm going to cut down the example I created to the minimum required to reproduce the problem (i.e. remove as much of the provisioning as possible). |
That'd be great thanks Will On 6 Sep 2016 9:26 am, "Will Falconer" notifications@github.com wrote:
|
@scrumtech that would help a lot, thanks :) On Tue, Sep 6, 2016 at 9:54 AM Matt Fellows notifications@github.com
|
@mefellows @mboudreau Quick question: does the test file FYI: removing all provisioning (except installing node) still reproduces the problem. |
@scrumtech, at this point it shouldn't affect it. I'll see if I can On Tue, Sep 6, 2016 at 11:25 AM Will Falconer notifications@github.com
|
@scrumtech Alright, I finally got some time to tinker with this. First, I'd like to say that your example simply didn't work. When I added After that, I didn't have many issues starting the server, however I did see an issue with the server check because vagrant was taking a while to spin up the instance for it to be available before the check hit it's timeout. I've increased the timeout to 30 seconds from 5 seconds. I think this is where the inconsistency came from when the VM was first starting. I don't think this will be an issue no more with the new version I've released, 4.5.3. Feel free to try it out, but I'm not sure what is the issue with your test functions not running properly. I would suggest you get those working first before trying again with pact-node. Cheers. |
The example works for me Michel on a clean checkout and install (not using Or Do you mean there is extraneous stuff that's not adding value? On Tuesday, 13 September 2016, Michel Boudreau notifications@github.com
Matt Fellows |
The example wasn't working at all for me. It never went into the beforeEach On Tue, Sep 13, 2016, 11:05 PM Matt Fellows notifications@github.com
|
@scrumtech had a chance to have a quick look at this. Your implementation worked for me on v4 and v6 locally. No issues. I'm not a Vagrant "connoisseur" so please excuse if some of my comments are a bit naive. Here's my results so far:
This is an issue I have seen a couple of times in Travis where a simple "re run" would fix the job. Unfortunately no solution as yet. I will keep digging. |
Thanks for digging @tarciosaraiva! The For now though... the plot thickens! |
ya that's not what I'm experiencing on my Vagrant box @mefellows - constant failures, taking 20+ minutes each time. I'm going through the code of Might be worth checking out to reduce the size of the binary. |
Yup, there's definitely some room for improvement on that front, but beware - as you'll see in the commit log (or maybe it was the verifier, but both have similar problems) we're still not convinced what is actually required to prevent stuff breaking on windows (at some point the distro was down 30% on what it was today). |
@tarciosaraiva I was having the exact same problems with npm install yesterday. Today it seems to be working (but still seems slow). I think the node registry is flaky. It sounds like there are some mirrors available, so if it happens again maybe we can try them out: http://stackoverflow.com/questions/6383894/npm-registry-alternative-to-http-registry-npmjs-org-npm |
@scrumtech I believe this is just caused by the mock server being very slow to start on vagrant / ubuntu. When I change the mocha timeout to be 10 seconds for starting the mock server then it works for me. I think we should improve the logging / README to help make it clearer that the server has not started yet.
|
One way to go around this slowness is to pass |
I thought @scrumtech tried that, along with increasing the timeout in pact-node itself (e.g. #20 (comment)). But if we missed that and it fixes it - then great! - we might want to make it configurable though. |
I've incremented it in the last release to 30 seconds from 10, but I did On Wed, Sep 21, 2016 at 2:08 PM Matt Fellows notifications@github.com
|
This is crazy - I'm somewhat confused with whats going on now. I've had trouble today getting FYI: problem with |
👏 glad to hear it's sort of working. Would love to get to the bottom of it but at least it seems like it's probably not a bug in the Pact Node/Js world. What do you see as the next steps @scrumtech ? |
As I was mentioning to @andrewspinks, I think we need to move way from the We will start using Pact now for integrating with a new service we are writing. So we will start to get our usage up and try to contribute going forward. |
That's great to hear @scrumtech! After my investigation last night I did some research today about what people are using for their Linux Vagrant boxes and most of them ran away from Glad to hear it's working now on your end. Looking forward to your contributions 👍 |
@scrumtech Good to hear. Can I close this issue then? |
See https://groups.google.com/forum/#!topic/pact-support/53nMFlG3EGY for background.
The text was updated successfully, but these errors were encountered: