divmain/drydock

Update to latest version of hapi

Closed this issue · 5 comments

We are attempting to start multiple instances of drydock in webdriverIO so that tests can be run in parallel and encountered an issue with hapi.

Since the port needs to be unique we attempted to use port scanning to find a free port and then start drydock, but since the tests run in parallel we encountered the race condition that the both processes selected the same free port, but one of the processes would still error with EADDRINUSE. I would have expected this error to be passed to the start callback, but appearantly there is a bug in hapi hapijs/hapi#2561.

This bug has already been fixed in latest hapi version, but is not in version 6.x used by drydock. I tried a simple update to package, but it appear the HAPI api has changed a bit.

Would you accept a PR that updates the HAPI version?

Absolutely - and let me know if you get stuck somewhere. I've been intending to make that change myself, but the benefits were mostly intangible before now.

Thanks. We decided using a random port had sufficiently low probability of collusion for now, so it might be awhile before we get back to this, but seems like a good thing to do eventually.

I can look at taking this on @divmain and @kurtharriger. What would you think about a precursor pull request to add some test coverage before we attempt the upgrade?

@mpfilbin, sorry this went completely off my radar. Adding some tests beforehand seems a reasonable step - feel free, if you're so inclined.

Sounds good @divmain. I think I can start work on that in a week or two.