Skip to content

Commit

Permalink
Add YAML test showing that segments are correctly divided between ind…
Browse files Browse the repository at this point in the history
…ices
  • Loading branch information
DaveCTurner committed Oct 29, 2021
1 parent b47c3d4 commit 682e022
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,50 @@
- match: { indices.index1.shards.0.0.routing.primary: true}
- match: { indices.index1.shards.0.0.segments._0.num_docs: 1}

---
"segments from multiple indices":

- do:
indices.create:
index: index1
body:
settings:
number_of_shards: "1"
number_of_replicas: "0"

- do:
indices.create:
index: index2
body:
settings:
number_of_shards: "1"
number_of_replicas: "0"

- do:
index:
index: index1
body: { foo: bar }
refresh: true

- do:
index:
index: index2
body: { foo: bar }
refresh: true

- do:
cluster.health:
wait_for_status: green

- do:
indices.segments: {}

- gte: { _shards.total: 2 }
- match: { indices.index1.shards.0.0.routing.primary: true}
- match: { indices.index1.shards.0.0.segments._0.num_docs: 1}
- match: { indices.index2.shards.0.0.routing.primary: true}
- match: { indices.index2.shards.0.0.segments._0.num_docs: 1}

---
"closed segments test":
- skip:
Expand Down

0 comments on commit 682e022

Please sign in to comment.