This PR fixes the two issues that were causing the tests failures that we have seen lately in CircleCI.
The two problems:
1) By accident, we were trying to instantiate a metrics server on each call to process_jobs. That's because we were calling Worker.work on each call to process_jobs and Worker.work starts the metrics server when configured to do so.
2) We did not wait enough after starting Puma. Sometimes we made requests before the control socket became ready.
@unleashed I found a second issue and added a fix for it in the second commit. I ran the tests multiple times in circleCI and it seems to be stable now.
This PR fixes the two issues that were causing the tests failures that we have seen lately in CircleCI.
The two problems: 1) By accident, we were trying to instantiate a metrics server on each call to
process_jobs
. That's because we were callingWorker.work
on each call toprocess_jobs
andWorker.work
starts the metrics server when configured to do so. 2) We did not wait enough after starting Puma. Sometimes we made requests before the control socket became ready.