浏览代码

Fix for SearchServiceTests#testWaitOnRefreshFailsIfCheckpointNotIndexed - increasing timeout for randomly failing test (#105395)

Panagiotis Bailis 1 年之前
父节点
当前提交
b8dc5c3041
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      server/src/test/java/org/elasticsearch/search/SearchServiceTests.java

+ 3 - 1
server/src/test/java/org/elasticsearch/search/SearchServiceTests.java

@@ -1767,7 +1767,9 @@ public class SearchServiceTests extends ESSingleNodeTestCase {
         final IndexService indexService = indicesService.indexServiceSafe(resolveIndex("index"));
         final IndexShard indexShard = indexService.getShard(0);
         SearchRequest searchRequest = new SearchRequest().allowPartialSearchResults(true);
-        searchRequest.setWaitForCheckpointsTimeout(TimeValue.timeValueMillis(randomIntBetween(10, 100)));
+        // Increased timeout to avoid cancelling the search task prior to its completion,
+        // as we expect to raise an Exception. Timeout itself is tested on the following `testWaitOnRefreshTimeout` test.
+        searchRequest.setWaitForCheckpointsTimeout(TimeValue.timeValueMillis(randomIntBetween(200, 300)));
         searchRequest.setWaitForCheckpoints(Collections.singletonMap("index", new long[] { 1 }));
 
         final DocWriteResponse response = prepareIndex("index").setSource("id", "1").get();