Skip to content

Add check to ensure data.results is not empty

John McDonnell requested to merge jmd-fix-distrubuted-reads-spec-bug into master

What does this MR do and why?

While investigating #378174 (closed) I noted that we do not do any type of assertion on the data.results array to ensure there's actually data to validate against.

In some situations we may get an empty result array back - {"status":"success","data":{"resultType":"vector","result":[]}} and in these cases this test should error out to indicate the environment isn't as expected.

  • on a brand new instance where no requests have happened
  • if the metric stops updating for some reason
  • if we misconfigure prometheus

In the mentioned E2E failures - the issue is a misconfiguration - and the spec 'reads from each node' should have also failed as a result.
However because it's an empty array - it manages to slip through and appears to be a passing test -- this is incorrect and this spec should have also failed in addition to the 'when a node is unhealthy' spec.

How to set up and validate locally

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by John McDonnell

Merge request reports

Loading