Skip to content

Commit

Permalink
Fix fetch_fields yaml test result order (#70149)
Browse files Browse the repository at this point in the history
The test failing in #69985 does so because under rare circumstance the result
order for match_all can be different. If we want to make assertions on specific
entries in the result, we should sort by a field that imposes a fixed result
ordering.

Closes #69985
  • Loading branch information
Christoph Büscher committed Mar 9, 2021
1 parent fa0351c commit e3e721f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ Test nested field inside object structure:
index: test
body:
_source: false
sort: "obj.other_obj_field"
fields: [ "*" ]
- length: { hits.hits.0.fields : 2 }
- match:
Expand All @@ -551,10 +552,13 @@ Test nested field inside object structure:
search:
index: test
body:
sort: "obj.other_obj_field"
_source: false
fields: ["obj.other_obj_field"]
- match:
hits.hits.0.fields.obj\.other_obj_field.0: other_value
- match:
hits.hits.1.fields.obj\.other_obj_field.0: other_value2

- do:
search:
Expand Down

0 comments on commit e3e721f

Please sign in to comment.