fix: flaky test for api/v1/targets/metadata. (#6436)
fix: flaky test for api/v1/targets/metadata. (#6436)

* Allows sorting of responses from the API in tests

Fixes flaky test for api/v1/targets/metadata.

Allows sorting of responses from the API. For our tests to be deterministic, we need to ensure the response from the API follows an order. This structure allows us to define one.

Fixes #6431

Signed-off-by: gotjosh <9f3349ce16d0d0fe87881d8bb1c6f554684be366@grafana.com>

GoogleCloudPlatform/prometheus,alileza/prometheus,GoogleCloudPlatform/prometheus,prometheus/prometheus,alileza/prometheus,prometheus/prometheus,keegancsmith/prometheus,kangwoo/prometheus,Gouthamve/prometheus,prometheus/prometheus,Gouthamve/prometheus,Gouthamve/prometheus,prometheus/prometheus,alileza/prometheus,keegancsmith/prometheus,kangwoo/prometheus,prometheus/prometheus,GoogleCloudPlatform/prometheus,GoogleCloudPlatform/prometheus,GoogleCloudPlatform/prometheus,keegancsmith/prometheus,kangwoo/prometheus,alileza/prometheus,keegancsmith/prometheus,keegancsmith/prometheus,alileza/prometheus,Gouthamve/prometheus,kangwoo/prometheus