Browse Source

Drop flaky assertion

Drops an assertion that we can't be sure will always pass. If we're
unlucky all documents with `_doc_count` can end up on a single shard and
our assertion won't pass. In yaml we don't have the ability to assert
that *either* shard has `_doc_count`. It's ok! We have an assertion for
this in another place too.

Close #71088
Nik Everett 4 years ago
parent
commit
c50fd8f3f1

+ 4 - 1
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/370_doc_count_field.yml

@@ -178,4 +178,7 @@ setup:
   - match: { aggregations.f.buckets.foo.doc_count: 8 }
   - match: { aggregations.f.buckets.xyz.doc_count: 5 }
   - match: { profile.shards.0.aggregations.0.type: FiltersAggregator.FilterByFilter }
-  - gte: { profile.shards.0.aggregations.0.debug.segments_with_doc_count_field: 1 }
+  # We can't assert that segments_with_doc_count_field is > 0 because we might
+  # end up with two shards and all of the documents with the _doc_count field
+  # may be on one field. We have a test for this in AggregationProfilerIT
+  # and here we'd prefer to have two shards to make sure that works.