Skip to content

Commit 2acf865

Browse files
Merge branch 'main' into feature/logsdb-ignore-dynamic-beyond-limit
2 parents 255ad7d + aabbc84 commit 2acf865

File tree

18 files changed

+1020
-973
lines changed

18 files changed

+1020
-973
lines changed

docs/reference/connector/docs/connectors-API-tutorial.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Refer to the individual connectors-references,connector references for these con
367367
====
368368
We're using a self-managed connector in this tutorial.
369369
To use these APIs with an Elastic managed connector, there's some extra setup for API keys.
370-
Refer to native-connectors-manage-API-keys for details.
370+
Refer to <<es-native-connectors-manage-API-keys>> for details.
371371
====
372372

373373
We're now ready to sync our PostgreSQL data to {es}.

muted-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ tests:
282282
- class: org.elasticsearch.oldrepos.OldRepositoryAccessIT
283283
method: testOldRepoAccess
284284
issue: https://github.com/elastic/elasticsearch/issues/115631
285-
- class: org.elasticsearch.xpack.esql.analysis.AnalyzerTests
286-
method: testMvAppendValidation
287-
issue: https://github.com/elastic/elasticsearch/issues/115636
285+
- class: org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT
286+
method: testCCSClusterDetailsWhereAllShardsSkippedInCanMatch
287+
issue: https://github.com/elastic/elasticsearch/issues/115652
288288

289289
# Examples:
290290
#

server/src/internalClusterTest/java/org/elasticsearch/action/admin/HotThreadsIT.java

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import org.apache.logging.log4j.Level;
1212
import org.apache.lucene.util.Constants;
13-
import org.elasticsearch.action.ActionListener;
13+
import org.elasticsearch.action.ActionFuture;
1414
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodeHotThreads;
1515
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsRequest;
1616
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsResponse;
@@ -26,15 +26,14 @@
2626
import org.hamcrest.Matcher;
2727

2828
import java.util.Map;
29-
import java.util.concurrent.CountDownLatch;
30-
import java.util.concurrent.atomic.AtomicBoolean;
29+
import java.util.concurrent.ExecutionException;
3130

3231
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
3332
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
3433
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
3534
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
35+
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertResponse;
3636
import static org.hamcrest.CoreMatchers.equalTo;
37-
import static org.hamcrest.CoreMatchers.is;
3837
import static org.hamcrest.CoreMatchers.notNullValue;
3938
import static org.hamcrest.Matchers.allOf;
4039
import static org.hamcrest.Matchers.containsString;
@@ -44,11 +43,10 @@
4443

4544
public class HotThreadsIT extends ESIntegTestCase {
4645

47-
public void testHotThreadsDontFail() throws InterruptedException {
46+
public void testHotThreadsDontFail() throws InterruptedException, ExecutionException {
4847
// This test just checks if nothing crashes or gets stuck etc.
4948
createIndex("test");
5049
final int iters = scaledRandomIntBetween(2, 20);
51-
final AtomicBoolean hasErrors = new AtomicBoolean(false);
5250
for (int i = 0; i < iters; i++) {
5351
final NodesHotThreadsRequest request = new NodesHotThreadsRequest(
5452
Strings.EMPTY_ARRAY,
@@ -67,36 +65,7 @@ public void testHotThreadsDontFail() throws InterruptedException {
6765
randomBoolean()
6866
)
6967
);
70-
final CountDownLatch latch = new CountDownLatch(1);
71-
client().execute(TransportNodesHotThreadsAction.TYPE, request, new ActionListener<>() {
72-
@Override
73-
public void onResponse(NodesHotThreadsResponse nodeHotThreads) {
74-
boolean success = false;
75-
try {
76-
assertThat(nodeHotThreads, notNullValue());
77-
Map<String, NodeHotThreads> nodesMap = nodeHotThreads.getNodesMap();
78-
assertThat(nodeHotThreads.failures(), empty());
79-
assertThat(nodesMap.size(), equalTo(cluster().size()));
80-
for (NodeHotThreads ht : nodeHotThreads.getNodes()) {
81-
assertNotNull(ht.getHotThreads());
82-
}
83-
success = true;
84-
} finally {
85-
if (success == false) {
86-
hasErrors.set(true);
87-
}
88-
latch.countDown();
89-
}
90-
}
91-
92-
@Override
93-
public void onFailure(Exception e) {
94-
logger.error("FAILED", e);
95-
hasErrors.set(true);
96-
latch.countDown();
97-
fail();
98-
}
99-
});
68+
final ActionFuture<NodesHotThreadsResponse> hotThreadsFuture = client().execute(TransportNodesHotThreadsAction.TYPE, request);
10069

10170
indexRandom(
10271
true,
@@ -105,7 +74,7 @@ public void onFailure(Exception e) {
10574
prepareIndex("test").setId("3").setSource("field1", "value3")
10675
);
10776
ensureSearchable();
108-
while (latch.getCount() > 0) {
77+
while (hotThreadsFuture.isDone() == false) {
10978
assertHitCount(
11079
prepareSearch().setQuery(matchAllQuery())
11180
.setPostFilter(
@@ -115,8 +84,15 @@ public void onFailure(Exception e) {
11584
3L
11685
);
11786
}
118-
safeAwait(latch);
119-
assertThat(hasErrors.get(), is(false));
87+
assertResponse(hotThreadsFuture, nodeHotThreads -> {
88+
assertThat(nodeHotThreads, notNullValue());
89+
Map<String, NodeHotThreads> nodesMap = nodeHotThreads.getNodesMap();
90+
assertThat(nodeHotThreads.failures(), empty());
91+
assertThat(nodesMap.size(), equalTo(cluster().size()));
92+
for (NodeHotThreads ht : nodeHotThreads.getNodes()) {
93+
assertNotNull(ht.getHotThreads());
94+
}
95+
});
12096
}
12197
}
12298

0 commit comments

Comments
 (0)