grafana / mimir

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.
https://grafana.com/oss/mimir/
GNU Affero General Public License v3.0
4.17k stars 535 forks source link

MQE: mangle native histograms in returned slices to catch use-after-return bugs + fix issues found #10010

Open charleskorn opened 21 hours ago

charleskorn commented 21 hours ago

What this PR does

This PR extends MQE's tests to aid in catching native histogram use-after-return bugs, and fixes some issues they've uncovered.

Now, during tests in the streamingpromql package, any histograms in slices returned to the HPoint or FloatHistogram pools will immediately be mutated. This ensures that any possible use-after-return bugs are triggered deterministically.

Which issue(s) this PR fixes or relates to

(none)

Checklist