elastic / apm-agent-ruby

https://www.elastic.co/solutions/apm
Apache License 2.0
168 stars 131 forks source link

Define separate method for creating sets for use in tests #1409

Closed estolfo closed 1 year ago

estolfo commented 1 year ago

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.