mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Revert "Search-999 Simplified repeat search"
This reverts commit 100dc80a9601b90f2098b73c2c6ac0da77ecce5f.
This commit is contained in:
@@ -166,17 +166,23 @@ public class AbstractSearchTest extends RestTest
|
||||
* @return true (indexing is finished) if search returns appropriate results
|
||||
* @throws Exception
|
||||
*/
|
||||
public boolean waitForIndexing(String userQuery, boolean expectedInResults) throws Exception
|
||||
public boolean waitForIndexing(String userQuery, Boolean expectedInResults) throws Exception
|
||||
{
|
||||
boolean found = false;
|
||||
boolean resultAsExpected = false;
|
||||
Boolean found = false;
|
||||
Boolean resultAsExpected = false;
|
||||
String expectedStatusCode = HttpStatus.OK.toString();
|
||||
|
||||
SearchRequest searchRequest = createQuery(userQuery);
|
||||
SearchResponse response = query(searchRequest);
|
||||
|
||||
// Repeat search until the query results are as expected or Search Retry count is hit
|
||||
for (int searchCount = 1; searchCount <= 3; searchCount++)
|
||||
{
|
||||
SearchRequest searchRequest = createQuery(userQuery);
|
||||
SearchResponse response = query(searchRequest);
|
||||
if (searchCount > 1)
|
||||
{
|
||||
// Wait for the solr indexing.
|
||||
Utility.waitToLoopTime(properties.getSolrWaitTimeInSeconds(), "Wait For Indexing");
|
||||
}
|
||||
|
||||
if (restClient.getStatusCode().matches(expectedStatusCode))
|
||||
{
|
||||
@@ -190,17 +196,11 @@ public class AbstractSearchTest extends RestTest
|
||||
}
|
||||
|
||||
// Loop again if result is not as expected: To cater for solr lag: eventual consistency
|
||||
resultAsExpected = (expectedInResults == found);
|
||||
|
||||
resultAsExpected = (expectedInResults.equals(found));
|
||||
if (resultAsExpected)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wait for the solr indexing.
|
||||
Utility.waitToLoopTime(properties.getSolrWaitTimeInSeconds(), "Wait For Indexing");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user