The tests sometimes fail because the collect method is called on the metrics sets before the method is mocked. This happens only on JRuby presumably because it's faster than MRI. This PR extracts the metrics sets definition into another method so it can be called in a test without the collecting timer task being started.
The tests sometimes fail because the
collect
method is called on the metrics sets before the method is mocked. This happens only on JRuby presumably because it's faster than MRI. This PR extracts the metrics sets definition into another method so it can be called in a test without the collecting timer task being started.