Skip to content

Commit

Permalink
Prepare aggregation yaml tests to be included in serverless build. (#…
Browse files Browse the repository at this point in the history
…99413)

* Remove setting the number of replicas in aggregation yaml tests.
* Stop waiting for yellow/green. The create index request by default return s when at least the primary shard has been assigned.
* Adjust assertions that are sensitive to the number of shard copies.
* Muted 4 aggregation yaml tests in mixed cluster qa ([link](https://github.com/elastic/elasticsearch/pull/99413/files#diff-033fa895a9866248015cbe7871deab0b3c88fa66a5e1bc9e789079d0d1a39f24R31)). These tests assert cache hits and with replicas we currently can't reliable assert this in a multi node test cluster. Like the mentioned comment suggest if the node selector can reliable select the same node, then we can unmute. I think muting is ok for now. These yaml tests are run in aggregation module and will soon be run in serverless. I think enforcing that many yaml tests run tests against indices with no replicas is worse for test coverage than muting 4 yaml tests in this qa module. Additionally I think that testing that the request cache work should not be tested in full blown integration tests, but more targeted unit/semi integration tests.
  • Loading branch information
martijnvg committed Sep 13, 2023
1 parent b1da97a commit a97915f
Show file tree
Hide file tree
Showing 42 changed files with 42 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ setup:
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
num:
Expand Down Expand Up @@ -75,7 +74,6 @@ setup:
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
num:
Expand All @@ -97,6 +95,7 @@ setup:
version: current # the version of the node that parsed the request is part of the cache key.
search:
index: test
preference: hit-same-shard-copy
body:
size: 0
aggs:
Expand Down Expand Up @@ -140,7 +139,7 @@ setup:

- do:
indices.stats: { index: test, metric: request_cache}
- match: { _shards.total: 1 }
- gte: { _shards.total: 1 }
- match: { indices.test.total.request_cache.hit_count: 0 }
- match: { indices.test.total.request_cache.miss_count: 1 }

Expand All @@ -150,6 +149,7 @@ setup:
version: current # the version of the node that parsed the request is part of the cache key.
search:
index: test
preference: hit-same-shard-copy
body:
size: 0
aggs:
Expand All @@ -176,6 +176,6 @@ setup:
path: num
- do:
indices.stats: { index: test, metric: request_cache}
- match: { _shards.total: 1 }
- gte: { _shards.total: 1 }
- match: { indices.test.total.request_cache.hit_count: 1 }
- match: { indices.test.total.request_cache.miss_count: 1 }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ setup:
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
date:
Expand Down Expand Up @@ -105,8 +104,6 @@ setup:
indices.create:
index: date_field_type_date
body:
settings:
number_of_replicas: 0
mappings:
properties:
date_field:
Expand All @@ -116,8 +113,6 @@ setup:
indices.create:
index: date_field_type_date_nanos
body:
settings:
number_of_replicas: 0
mappings:
properties:
date_field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ setup:
indices.create:
index: test_1
body:
settings:
number_of_replicas: 0
mappings:
properties:
int_field:
Expand Down Expand Up @@ -47,8 +45,6 @@ setup:
indices.create:
index: test_2
body:
settings:
number_of_replicas: 0
mappings:
properties:
other_field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ setup:
indices.create:
index: test_1
body:
settings:
number_of_replicas: 0
mappings:
properties:
int_field:
Expand Down Expand Up @@ -47,8 +45,6 @@ setup:
indices.create:
index: test_2
body:
settings:
number_of_replicas: 0
mappings:
properties:
other_field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ setup:
indices.create:
index: date_histogram_timezone_test
body:
settings:
number_of_replicas: 0
mappings:
properties:
date:
Expand Down Expand Up @@ -1621,8 +1619,6 @@ setup:
indices.create:
index: date_field_type_date
body:
settings:
number_of_replicas: 0
mappings:
properties:
date_field:
Expand All @@ -1632,8 +1628,6 @@ setup:
indices.create:
index: date_field_type_date_nanos
body:
settings:
number_of_replicas: 0
mappings:
properties:
date_field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ setup:
settings:
index:
number_of_shards: 1
number_of_replicas: 0
sort:
field: date
order: desc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ setup:
indices.create:
index: date_histogram_timezone_test
body:
settings:
number_of_replicas: 0
mappings:
properties:
date:
Expand All @@ -36,8 +34,6 @@ setup:
indices.create:
index: test_timezone_date_nanos
body:
settings:
number_of_replicas: 0
mappings:
properties:
date:
Expand All @@ -47,8 +43,6 @@ setup:
indices.create:
index: timezone_daylight_test
body:
settings:
number_of_replicas: 0
mappings:
properties:
date:
Expand Down Expand Up @@ -499,8 +493,6 @@ setup:
indices.create:
index: date_field_type_date
body:
settings:
number_of_replicas: 0
mappings:
properties:
date_field:
Expand All @@ -510,8 +502,6 @@ setup:
indices.create:
index: date_field_type_date_nanos
body:
settings:
number_of_replicas: 0
mappings:
properties:
date_field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ setup:
indices.create:
index: old_test
body:
settings:
number_of_replicas: 0
mappings:
properties:
date:
Expand All @@ -15,24 +13,18 @@ setup:
indices.create:
index: test
body:
settings:
number_of_replicas: 0
mappings:
properties:
date:
type: date
format: epoch_second

- do:
cluster.health:
wait_for_status: yellow

# March 8th 2020 was the start of daylight savings time that year
- do:
bulk:
index: test
refresh: true
body:
body:
- {"index": {}}
- { "date" : "2020-03-08T06:15:00Z" }
- {"index": {}}
Expand All @@ -44,7 +36,7 @@ setup:
bulk:
index: old_test
refresh: true
body:
body:
- {"index": {}}
- { "date" : 1000 }
- {"index": {}}
Expand All @@ -56,15 +48,15 @@ setup:
search:
body:
size: 0
aggs:
date_range:
date_range:
aggs:
date_range:
date_range:
field: "date"
ranges:
-
ranges:
-
from: 1000
to: 3000
-
-
from: 3000
to: 4000

Expand Down Expand Up @@ -141,7 +133,6 @@ setup:
body:
settings:
number_of_shards: 1
number_of_replicas: 0
- do:
search:
index: test_a_unmapped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ setup:
indices.create:
index: test_1
body:
settings:
number_of_replicas: 0
mappings:
properties:
str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ setup:
indices.create:
index: test_1
body:
settings:
number_of_replicas: 0
mappings:
properties:
int_field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ setup:
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
mentions:
Expand Down Expand Up @@ -35,6 +34,7 @@ setup:
rest_total_hits_as_int: true
size: 0
request_cache: true
preference: hit-same-shard-copy
body:
aggs:
itemsNotify:
Expand All @@ -58,7 +58,7 @@ setup:
# The first request will miss the cache
- do:
indices.stats: { index: test, metric: request_cache}
- match: { _shards.total: 1 }
- gte: { _shards.total: 1 }
- match: { indices.test.total.request_cache.hit_count: 0 }
- match: { indices.test.total.request_cache.miss_count: 1 }

Expand All @@ -69,6 +69,7 @@ setup:
rest_total_hits_as_int: true
size: 0
request_cache: true
preference: hit-same-shard-copy
body:
aggs:
itemsNotify:
Expand All @@ -92,7 +93,7 @@ setup:
# The second result with hit the cache
- do:
indices.stats: { index: test, metric: request_cache}
- match: { _shards.total: 1 }
- gte: { _shards.total: 1 }
- match: { indices.test.total.request_cache.hit_count: 1 }
- match: { indices.test.total.request_cache.miss_count: 1 }

Expand All @@ -108,6 +109,7 @@ setup:
rest_total_hits_as_int: true
size: 0
request_cache: true
preference: hit-same-shard-copy
body:
aggs:
itemsNotify:
Expand All @@ -128,7 +130,7 @@ setup:
# The first request will miss the cache
- do:
indices.stats: { index: test, metric: request_cache}
- match: { _shards.total: 1 }
- gte: { _shards.total: 1 }
- match: { indices.test.total.request_cache.hit_count: 0 }
- match: { indices.test.total.request_cache.miss_count: 1 }
- is_true: indices.test
Expand All @@ -141,6 +143,7 @@ setup:
rest_total_hits_as_int: true
size: 0
request_cache: true
preference: hit-same-shard-copy
body:
aggs:
itemsNotify:
Expand All @@ -161,7 +164,7 @@ setup:
# The first request will miss the cache
- do:
indices.stats: { index: test, metric: request_cache}
- match: { _shards.total: 1 }
- gte: { _shards.total: 1 }
- match: { indices.test.total.request_cache.hit_count: 1 }
- match: { indices.test.total.request_cache.miss_count: 1 }

Expand Down

0 comments on commit a97915f

Please sign in to comment.