Skip to content

Commit

Permalink
addressing test failures in search request validation due to randomly…
Browse files Browse the repository at this point in the history
… enabled scrolling
  • Loading branch information
pmpailis committed Jul 25, 2024
1 parent 29266a7 commit a75e885
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.elasticsearch.action.support.ChannelActionListener;
import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.GroupShardsIterator;
import org.elasticsearch.common.inject.Inject;
Expand Down Expand Up @@ -63,7 +62,6 @@ public class TransportOpenPointInTimeAction extends HandledTransportAction<OpenP
private final NamedWriteableRegistry namedWriteableRegistry;
private final TransportService transportService;
private final SearchService searchService;
private final Client client;

@Inject
public TransportOpenPointInTimeAction(
Expand All @@ -72,16 +70,14 @@ public TransportOpenPointInTimeAction(
ActionFilters actionFilters,
TransportSearchAction transportSearchAction,
SearchTransportService searchTransportService,
NamedWriteableRegistry namedWriteableRegistry,
Client client
NamedWriteableRegistry namedWriteableRegistry
) {
super(TYPE.name(), transportService, actionFilters, OpenPointInTimeRequest::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
this.transportService = transportService;
this.transportSearchAction = transportSearchAction;
this.searchService = searchService;
this.searchTransportService = searchTransportService;
this.namedWriteableRegistry = namedWriteableRegistry;
this.client = client;
transportService.registerRequestHandler(
OPEN_SHARD_READER_CONTEXT_NAME,
EsExecutors.DIRECT_EXECUTOR_SERVICE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public boolean isCompound() {
}
}));
searchRequest.allowPartialSearchResults(true);
searchRequest.scroll((Scroll) null);
ActionRequestValidationException validationErrors = searchRequest.validate();
assertNotNull(validationErrors);
assertEquals(1, validationErrors.validationErrors().size());
Expand All @@ -309,7 +310,7 @@ public void extractToSearchSourceBuilder(SearchSourceBuilder searchSourceBuilder

@Override
public String getName() {
return "compound_retriever";
return "not_a_compound_retriever";
}

@Override
Expand All @@ -326,6 +327,7 @@ protected int doHashCode() {
}
}));
searchRequest.allowPartialSearchResults(true);
searchRequest.scroll((Scroll) null);
ActionRequestValidationException validationErrors = searchRequest.validate();
assertNull(validationErrors);
}
Expand Down Expand Up @@ -360,6 +362,7 @@ public boolean isCompound() {
return true;
}
}));
searchRequest.scroll((Scroll) null);
ActionRequestValidationException validationErrors = searchRequest.validate();
assertNull(validationErrors);
}
Expand Down

0 comments on commit a75e885

Please sign in to comment.