Skip to content
Snippets Groups Projects

Add check to ensure data.results is not empty

Merged John McDonnell requested to merge jmd-fix-distrubuted-reads-spec-bug into master
1 unresolved thread

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

Merged results pipeline #703829136 passed with warnings

Pipeline: GitLab

#703831140

    Pipeline: GitLab

    #703831151

      Merged results pipeline passed with warnings for 6d9943fc

      Approved by

      Merged by Mark LapierreMark Lapierre 2 years ago (Nov 29, 2022 2:06am UTC)

      Merge details

      Pipeline #707531512 passed

      Pipeline passed for f4c87752 on master

      10 environments impacted.

      Activity

      Filter activity
      • Approvals
      • Assignees & reviewers
      • Comments (from bots)
      • Comments (from users)
      • Commits & branches
      • Edits
      • Labels
      • Lock status
      • Mentions
      • Merge request status
      • Tracking
      Please register or sign in to reply
      Loading