mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Fix failure in SearchCancellationIT.testMSearchChildReqCancellationWithHybridTimeout (#1105)
In some cases as one shared with issue #1099, the maxConcurrentSearchRequests was chosen as 0 which will compute the final value during execution of the request based on processor counts. When this computed value is less than number of search request in msearch request, it will execute all the requests in multiple iterations causing the failure since test will only wait for one such iteration. Hence setting the maxConcurrentSearchRequests explicitly to number of search requests being added in the test to ensure correct behavior Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>
This commit is contained in:
parent
8af1b91b7b
commit
55c1026bb6
@ -509,7 +509,7 @@ public class SearchCancellationIT extends OpenSearchIntegTestCase {
|
||||
client().admin().cluster().prepareUpdateSettings().setPersistentSettings(Settings.builder()
|
||||
.put(SEARCH_CANCEL_AFTER_TIME_INTERVAL_SETTING_KEY, cancellationTimeout)
|
||||
.build()).get();
|
||||
ActionFuture<MultiSearchResponse> mSearchResponse = client().prepareMultiSearch()
|
||||
ActionFuture<MultiSearchResponse> mSearchResponse = client().prepareMultiSearch().setMaxConcurrentSearchRequests(2)
|
||||
.add(client().prepareSearch("test").setAllowPartialSearchResults(randomBoolean())
|
||||
.setQuery(scriptQuery(new Script(ScriptType.INLINE, "mockscript", ScriptedBlockPlugin.SCRIPT_NAME,
|
||||
Collections.emptyMap()))))
|
||||
@ -541,7 +541,7 @@ public class SearchCancellationIT extends OpenSearchIntegTestCase {
|
||||
client().admin().cluster().prepareUpdateSettings().setPersistentSettings(Settings.builder()
|
||||
.put(SEARCH_CANCEL_AFTER_TIME_INTERVAL_SETTING_KEY, clusterCancellationTimeout)
|
||||
.build()).get();
|
||||
ActionFuture<MultiSearchResponse> mSearchResponse = client().prepareMultiSearch()
|
||||
ActionFuture<MultiSearchResponse> mSearchResponse = client().prepareMultiSearch().setMaxConcurrentSearchRequests(3)
|
||||
.add(client().prepareSearch("test").setAllowPartialSearchResults(randomBoolean())
|
||||
.setCancelAfterTimeInterval(reqCancellationTimeout)
|
||||
.setQuery(scriptQuery(new Script(ScriptType.INLINE, "mockscript", ScriptedBlockPlugin.SCRIPT_NAME,
|
||||
|
Loading…
x
Reference in New Issue
Block a user