[7.x] Add test for item-level error when no write index defined for an alias in bulk API (#55503) (#61999)

Add test for item-level error when no write index defined for an alia…
Co-authored-by: Jake Landis <jake.landis@elastic.co>
Co-authored-by: bellengao <gbl_long@163.com>
This commit is contained in:
Jake Landis 2020-09-09 14:27:25 -05:00 committed by GitHub
parent d8dad9ab2c
commit e80f68ed77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

View File

@ -205,3 +205,36 @@
catch: missing
indices.get:
index: new_index_not_created
---
"Return item-level error when no write index defined for an alias":
- skip:
version: " - 7.8.99"
reason: "supporting code added in 7.9.0"
- do:
indices.create:
index: test_index1
- do:
indices.create:
index: test_index2
- do:
indices.put_alias:
index: test_index1
name: test_index
- do:
indices.put_alias:
index: test_index2
name: test_index
- do:
bulk:
body:
- '{"index": {"_index": "test_index"}}'
- '{"field": "test"}'
- match: { errors: true }
- match: { items.0.index.status: 400 }
- match: { items.0.index.error.type: illegal_argument_exception }
- match: { items.0.index.error.reason: "no write index is defined for alias [test_index]. The write index may be explicitly disabled using is_write_index=false or the alias points to multiple indices without one being designated as a write index" }