From 1ba3f7cbf494d5fd6d79af9778c56cec2b353bd7 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Wed, 3 Jan 2024 17:48:37 -0600 Subject: [PATCH] fixing esql test --- .../xpack/esql/action/CrossClustersCancellationIT.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClustersCancellationIT.java b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClustersCancellationIT.java index 5573755d9850a..6fc368763aece 100644 --- a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClustersCancellationIT.java +++ b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClustersCancellationIT.java @@ -153,7 +153,12 @@ private void createRemoteIndex(int numDocs) throws Exception { BulkRequestBuilder bulk = client(REMOTE_CLUSTER).prepareBulk("test").setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); try { for (int i = 0; i < numDocs; i++) { - bulk.add(new IndexRequest().source("foo", i)); + IndexRequest indexRequest = new IndexRequest().source("foo", i); + try { + bulk.add(indexRequest); + } finally { + indexRequest.decRef(); + } } bulk.get(); } finally {