We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4d0f8d commit b8cfca5Copy full SHA for b8cfca5
elasticsearch-api/api-spec-testing/test_file/action.rb
@@ -94,6 +94,16 @@ def execute(client, test = nil)
94
args.merge!('reassign' => true) unless args['reassign'] === false
95
@response = client.send(_method, prepare_arguments(args, test))
96
client
97
+ when 'create'
98
+ begin
99
+ @response = client.send(_method, prepare_arguments(args, test))
100
+ rescue Elastic::Transport::Transport::Errors::BadRequest => e
101
+ raise e unless e.message.match 'resource_already_exists_exception'
102
+
103
+ client.delete(index: args['index'])
104
105
+ end
106
+ client
107
else
108
109
0 commit comments