3scale / apisonator

Red Hat 3scale API Management Apisonator backend
https://3scale.net
Apache License 2.0
35 stars 27 forks source link

Fix flaky tests in prometheus metrics tests #182

Closed davidor closed 4 years ago

davidor commented 4 years ago

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.

davidor commented 4 years ago

@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.