Skip to content

Commit 50ed3d8

Browse files
committed
iter
1 parent 84561b5 commit 50ed3d8

File tree

2 files changed

+15
-31
lines changed

2 files changed

+15
-31
lines changed

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankMultiNodeTests.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
package org.elasticsearch.xpack.inference.rank.textsimilarity;
99

10+
import org.elasticsearch.action.search.SearchPhaseExecutionException;
11+
import org.elasticsearch.action.search.SearchResponse;
1012
import org.elasticsearch.plugins.Plugin;
1113
import org.elasticsearch.search.rank.RankBuilder;
1214
import org.elasticsearch.search.rank.rerank.AbstractRerankerIT;
@@ -15,6 +17,10 @@
1517
import java.util.Collection;
1618
import java.util.List;
1719

20+
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
21+
import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery;
22+
import static org.elasticsearch.index.query.QueryBuilders.matchQuery;
23+
1824
public class TextSimilarityRankMultiNodeTests extends AbstractRerankerIT {
1925

2026
private static final String inferenceId = "inference-id";
@@ -42,4 +48,13 @@ protected RankBuilder getThrowingRankBuilder(int rankWindowSize, String rankFeat
4248
protected Collection<Class<? extends Plugin>> pluginsNeeded() {
4349
return List.of(InferencePlugin.class, TextSimilarityTestPlugin.class);
4450
}
51+
52+
53+
public void testQueryPhaseShardThrowingAllShardsFail() throws Exception {
54+
// no-op
55+
}
56+
57+
public void testQueryPhaseCoordinatorThrowingAllShardsFail() throws Exception {
58+
// no-op
59+
}
4560
}

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityTestPlugin.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -247,37 +247,6 @@ public void doXContent(XContentBuilder builder, ToXContent.Params params) throws
247247
builder.field(THROWING_TYPE_FIELD.getPreferredName(), throwingRankBuilderType);
248248
}
249249

250-
@Override
251-
public QueryPhaseRankShardContext buildQueryPhaseShardContext(List<Query> queries, int from) {
252-
if (this.throwingRankBuilderType == AbstractRerankerIT.ThrowingRankBuilderType.THROWING_QUERY_PHASE_SHARD_CONTEXT)
253-
return new QueryPhaseRankShardContext(queries, rankWindowSize()) {
254-
@Override
255-
public RankShardResult combineQueryPhaseResults(List<TopDocs> rankResults) {
256-
throw new UnsupportedOperationException("qps - simulated failure");
257-
}
258-
};
259-
else {
260-
return super.buildQueryPhaseShardContext(queries, from);
261-
}
262-
}
263-
264-
@Override
265-
public QueryPhaseRankCoordinatorContext buildQueryPhaseCoordinatorContext(int size, int from) {
266-
if (this.throwingRankBuilderType == AbstractRerankerIT.ThrowingRankBuilderType.THROWING_QUERY_PHASE_COORDINATOR_CONTEXT)
267-
return new QueryPhaseRankCoordinatorContext(rankWindowSize()) {
268-
@Override
269-
public ScoreDoc[] rankQueryPhaseResults(
270-
List<QuerySearchResult> querySearchResults,
271-
SearchPhaseController.TopDocsStats topDocStats
272-
) {
273-
throw new UnsupportedOperationException("qpc - simulated failure");
274-
}
275-
};
276-
else {
277-
return super.buildQueryPhaseCoordinatorContext(size, from);
278-
}
279-
}
280-
281250
@Override
282251
public RankFeaturePhaseRankShardContext buildRankFeaturePhaseShardContext() {
283252
if (this.throwingRankBuilderType == AbstractRerankerIT.ThrowingRankBuilderType.THROWING_RANK_FEATURE_PHASE_SHARD_CONTEXT)

0 commit comments

Comments
 (0)