Skip to content

Fix aggs test failures #74750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import static io.github.nik9000.mapmatcher.MapMatcher.matchesMap;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.nullValue;
Expand Down Expand Up @@ -390,7 +391,7 @@ public void testRangeFilter() throws IOException {
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 0)
.entry("segments_counted", 1)
.entry("segments_counted", greaterThanOrEqualTo(1))
.entry("filters", matchesList().item(matchesMap().entry("query", "test:[1577836800000 TO 1583020799999]")))
)
);
Expand Down Expand Up @@ -450,7 +451,7 @@ public void testMatchAll() throws IOException {
debug,
matchesMap().entry(
"test",
matchesMap().entry("segments_counted", 1)
matchesMap().entry("segments_counted", greaterThanOrEqualTo(1))
.entry("segments_collected", 0)
.entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
Expand Down Expand Up @@ -488,9 +489,9 @@ public void testMatchAllWithDocCount() throws IOException {
debug,
matchesMap().entry(
"test",
matchesMap().entry("segments_counted", 1)
matchesMap().entry("segments_counted", greaterThanOrEqualTo(1))
.entry("segments_collected", 0)
.entry("segments_with_doc_count_field", 1)
.entry("segments_with_doc_count_field", greaterThanOrEqualTo(1))
.entry("segments_with_deleted_docs", 0)
.entry(
"filters",
Expand Down Expand Up @@ -558,7 +559,7 @@ public void onCache(ShardId shardId, Accountable accountable) {}
aggregator.collectDebugInfo(debug::put);
assertMap(
debug,
matchesMap().entry("segments_counted", 1)
matchesMap().entry("segments_counted", greaterThanOrEqualTo(1))
.entry("segments_collected", 0)
.entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
Expand Down Expand Up @@ -645,7 +646,7 @@ public void testMatchNoneFilter() throws IOException {
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 0)
.entry("segments_counted", 1)
.entry("segments_counted", greaterThanOrEqualTo(1))
.entry(
"filters",
matchesList().item(
Expand Down Expand Up @@ -682,7 +683,7 @@ public void testMatchNoneTopLevel() throws IOException {
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 0)
.entry("segments_counted", 1)
.entry("segments_counted", greaterThanOrEqualTo(1))
.entry(
"filters",
matchesList().item(
Expand Down Expand Up @@ -721,7 +722,7 @@ public void testTermFilter() throws IOException {
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 0)
.entry("segments_counted", 1)
.entry("segments_counted", greaterThanOrEqualTo(1))
.entry(
"filters",
matchesList().item(
Expand Down Expand Up @@ -762,7 +763,7 @@ public void testTermTopLevel() throws IOException {
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 0)
.entry("segments_counted", 1)
.entry("segments_counted", greaterThanOrEqualTo(1))
.entry(
"filters",
matchesList().item(
Expand Down Expand Up @@ -849,7 +850,7 @@ public void testSubAggs() throws IOException {
"test",
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 1)
.entry("segments_collected", greaterThanOrEqualTo(1))
.entry("segments_counted", 0)
.entry(
"filters",
Expand Down Expand Up @@ -925,7 +926,7 @@ public void testSubAggsManyDocs() throws IOException {
"test",
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 1)
.entry("segments_collected", greaterThanOrEqualTo(1))
.entry("segments_counted", 0)
.entry("filters", hasSize(2))
).entry("test.s", matchesMap()).entry("test.m", matchesMap())
Expand Down Expand Up @@ -1004,7 +1005,7 @@ public void testSubAggsManyFilters() throws IOException {
"test",
matchesMap().entry("segments_with_doc_count_field", 0)
.entry("segments_with_deleted_docs", 0)
.entry("segments_collected", 1)
.entry("segments_collected", greaterThanOrEqualTo(1))
.entry("segments_counted", 0)
.entry("filters", hasSize(buckets.size()))
).entry("test.s", matchesMap()).entry("test.m", matchesMap())
Expand Down