Skip to content

Commit 1640230

Browse files
committed
Merge branch 'master' into ccr
* master: [CI] Mute Ml rolling upgrade tests Fix license on AcitveDirectorySIDUtil (#30972) [Test] Prefer ArrayList over Vector (#30965) [CI] Mute HttpSecretsIntegrationTests#testWebhookAction test Mute FlushIT tests Add “took” timing info to response for _msearch/template API (#30961)
2 parents 8793ebc + 8e4ab82 commit 1640230

File tree

9 files changed

+50
-11
lines changed

9 files changed

+50
-11
lines changed

modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
package org.elasticsearch.script.mustache;
2121

2222
import org.elasticsearch.ElasticsearchException;
23+
import org.elasticsearch.Version;
2324
import org.elasticsearch.action.ActionResponse;
2425
import org.elasticsearch.common.Nullable;
2526
import org.elasticsearch.common.Strings;
2627
import org.elasticsearch.common.io.stream.StreamInput;
2728
import org.elasticsearch.common.io.stream.StreamOutput;
2829
import org.elasticsearch.common.io.stream.Streamable;
30+
import org.elasticsearch.common.unit.TimeValue;
2931
import org.elasticsearch.common.xcontent.ToXContent;
3032
import org.elasticsearch.common.xcontent.ToXContentObject;
3133
import org.elasticsearch.common.xcontent.XContentBuilder;
@@ -107,12 +109,14 @@ public Exception getFailure() {
107109
}
108110

109111
private Item[] items;
110-
112+
private long tookInMillis;
113+
111114
MultiSearchTemplateResponse() {
112115
}
113116

114-
public MultiSearchTemplateResponse(Item[] items) {
117+
public MultiSearchTemplateResponse(Item[] items, long tookInMillis) {
115118
this.items = items;
119+
this.tookInMillis = tookInMillis;
116120
}
117121

118122
@Override
@@ -126,6 +130,13 @@ public Iterator<Item> iterator() {
126130
public Item[] getResponses() {
127131
return this.items;
128132
}
133+
134+
/**
135+
* How long the msearch_template took.
136+
*/
137+
public TimeValue getTook() {
138+
return new TimeValue(tookInMillis);
139+
}
129140

130141
@Override
131142
public void readFrom(StreamInput in) throws IOException {
@@ -134,6 +145,9 @@ public void readFrom(StreamInput in) throws IOException {
134145
for (int i = 0; i < items.length; i++) {
135146
items[i] = Item.readItem(in);
136147
}
148+
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
149+
tookInMillis = in.readVLong();
150+
}
137151
}
138152

139153
@Override
@@ -143,11 +157,15 @@ public void writeTo(StreamOutput out) throws IOException {
143157
for (Item item : items) {
144158
item.writeTo(out);
145159
}
160+
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
161+
out.writeVLong(tookInMillis);
162+
}
146163
}
147164

148165
@Override
149166
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
150167
builder.startObject();
168+
builder.field("took", tookInMillis);
151169
builder.startArray(Fields.RESPONSES);
152170
for (Item item : items) {
153171
if (item.isFailure()) {

modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportMultiSearchTemplateAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected void doExecute(MultiSearchTemplateRequest request, ActionListener<Mult
9494
items[originalSlot].getResponse().setResponse(item.getResponse());
9595
}
9696
}
97-
listener.onResponse(new MultiSearchTemplateResponse(items));
97+
listener.onResponse(new MultiSearchTemplateResponse(items, r.getTook().millis()));
9898
}, listener::onFailure));
9999
}
100100
}

modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
3838
import static org.hamcrest.Matchers.arrayWithSize;
3939
import static org.hamcrest.Matchers.equalTo;
40+
import static org.hamcrest.Matchers.greaterThan;
4041
import static org.hamcrest.Matchers.instanceOf;
4142
import static org.hamcrest.core.Is.is;
4243

@@ -140,6 +141,7 @@ public void testBasic() throws Exception {
140141

141142
MultiSearchTemplateResponse response = client().execute(MultiSearchTemplateAction.INSTANCE, multiRequest).get();
142143
assertThat(response.getResponses(), arrayWithSize(5));
144+
assertThat(response.getTook().millis(), greaterThan(0L));
143145

144146
MultiSearchTemplateResponse.Item response1 = response.getResponses()[0];
145147
assertThat(response1.isFailure(), is(false));

modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/MeanReciprocalRankTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.Arrays;
3939
import java.util.Collections;
4040
import java.util.List;
41-
import java.util.Vector;
4241

4342
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
4443
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
@@ -146,7 +145,7 @@ public void testPrecisionAtFiveRelevanceThreshold() {
146145

147146
public void testCombine() {
148147
MeanReciprocalRank reciprocalRank = new MeanReciprocalRank();
149-
Vector<EvalQueryQuality> partialResults = new Vector<>(3);
148+
List<EvalQueryQuality> partialResults = new ArrayList<>(3);
150149
partialResults.add(new EvalQueryQuality("id1", 0.5));
151150
partialResults.add(new EvalQueryQuality("id2", 1.0));
152151
partialResults.add(new EvalQueryQuality("id3", 0.75));

modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/PrecisionAtKTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.Arrays;
3939
import java.util.Collections;
4040
import java.util.List;
41-
import java.util.Vector;
4241

4342
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
4443
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
@@ -163,7 +162,7 @@ public void testParseFromXContent() throws IOException {
163162

164163
public void testCombine() {
165164
PrecisionAtK metric = new PrecisionAtK();
166-
Vector<EvalQueryQuality> partialResults = new Vector<>(3);
165+
List<EvalQueryQuality> partialResults = new ArrayList<>(3);
167166
partialResults.add(new EvalQueryQuality("a", 0.1));
168167
partialResults.add(new EvalQueryQuality("b", 0.2));
169168
partialResults.add(new EvalQueryQuality("c", 0.6));

server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ private String syncedFlushDescription(ShardsSyncedFlushResult result) {
254254
result.totalShards(), result.failed(), result.failureReason(), detail);
255255
}
256256

257+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29392")
257258
@TestLogging("_root:DEBUG,org.elasticsearch.indices.flush:TRACE")
258259
public void testSyncedFlushSkipOutOfSyncReplicas() throws Exception {
259260
internalCluster().ensureAtLeastNumDataNodes(between(2, 3));
@@ -296,6 +297,7 @@ public void testSyncedFlushSkipOutOfSyncReplicas() throws Exception {
296297
assertThat(fullResult.successfulShards(), equalTo(numberOfReplicas + 1));
297298
}
298299

300+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29392")
299301
@TestLogging("_root:DEBUG,org.elasticsearch.indices.flush:TRACE")
300302
public void testDoNotRenewSyncedFlushWhenAllSealed() throws Exception {
301303
internalCluster().ensureAtLeastNumDataNodes(between(2, 3));

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySIDUtil.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
/*
2-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License;
4-
* you may not use this file except in compliance with the Elastic License.
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
518
*/
619

720
/*

x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public void testHttpInput() throws Exception {
165165
is(ApplicableBasicAuth.headerValue(USERNAME, PASSWORD.toCharArray())));
166166
}
167167

168+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/30094")
168169
public void testWebhookAction() throws Exception {
169170
WatcherClient watcherClient = watcherClient();
170171
watcherClient.preparePutWatch("_id")

x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/30_ml_jobs_crud.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ setup:
88

99
---
1010
"Test open old jobs":
11-
11+
- skip:
12+
version: "all"
13+
reason: "@AwaitsFix: https://github.com/elastic/elasticsearch/issues/30982"
1214
- do:
1315
xpack.ml.open_job:
1416
job_id: old-cluster-job
@@ -75,6 +77,9 @@ setup:
7577

7678
---
7779
"Test job with no model memory limit has established model memory after reopening":
80+
- skip:
81+
version: "all"
82+
reason: "@AwaitsFix: https://github.com/elastic/elasticsearch/issues/30982"
7883
- do:
7984
xpack.ml.open_job:
8085
job_id: no-model-memory-limit-job

0 commit comments

Comments
 (0)