From 9511c546806fc1cff3b8db3c77e9c6cea6e96eaf Mon Sep 17 00:00:00 2001 From: Stuart Tettemer Date: Thu, 28 Oct 2021 11:36:50 -0500 Subject: [PATCH] Scriptfield test: set number of shards to 1 (#80026) The 20_scriptfield:"Scripted Field with error accessing an unsupported field via the script fields api" test expects to fail because the field is not yet supported in the fields API. However, if the number of shards in the target index is randomly more than one, the empty shard will succeed leading to a 200 response rather than the expected 400 response. This change forces the number of shards to 1 to avoid this scenario. Fixes: #79986 --- .../resources/rest-api-spec/test/painless/20_scriptfield.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/20_scriptfield.yml b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/20_scriptfield.yml index 7c3a9d975efeb..d480a1e722d55 100644 --- a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/20_scriptfield.yml +++ b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/20_scriptfield.yml @@ -5,6 +5,8 @@ setup: indices.create: index: test body: + settings: + number_of_shards: "1" mappings: properties: foo: