summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-05-24 13:10:30 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-05-24 13:10:30 +0200
commit2200df4ffbdf7d8de9f671ef6168558c4362e191 (patch)
tree5186ad30e817cc2f3e55895fcf5a7f5c468d85e1 /container-search
parentd06ec4eac1df145e6b52edf3734a3f130a9ffc02 (diff)
Increase timeout
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java2
-rw-r--r--container-search/src/test/java/com/yahoo/search/cluster/test/ClusteredConnectionTestCase.java27
2 files changed, 17 insertions, 12 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java
index ff099d4d490..e99199d85f7 100644
--- a/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java
+++ b/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java
@@ -160,7 +160,7 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod
result = robustSearch(query, execution, connection);
- if (!shouldRetry(query, result))
+ if ( ! shouldRetry(query, result))
return result;
if (query.getTraceLevel() >= 6)
diff --git a/container-search/src/test/java/com/yahoo/search/cluster/test/ClusteredConnectionTestCase.java b/container-search/src/test/java/com/yahoo/search/cluster/test/ClusteredConnectionTestCase.java
index a565c171b98..a35cbdf289e 100644
--- a/container-search/src/test/java/com/yahoo/search/cluster/test/ClusteredConnectionTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/cluster/test/ClusteredConnectionTestCase.java
@@ -34,7 +34,7 @@ public class ClusteredConnectionTestCase {
connections.add(connection0);
connections.add(connection1);
connections.add(connection2);
- MyBackend myBackend=new MyBackend(new ComponentId("test"),connections);
+ MyBackend myBackend = new MyBackend(new ComponentId("test"), connections);
Result r;
r=new Execution(myBackend, Execution.Context.createContextStub()).search(new SimpleQuery(0));
@@ -67,7 +67,7 @@ public class ClusteredConnectionTestCase {
assertEquals("from:0",r.hits().get(0).getId().stringValue());
connection0.setInService(false);
- r=new Execution(myBackend, Execution.Context.createContextStub()).search(new SimpleQuery(0));
+ r = new Execution(myBackend, Execution.Context.createContextStub()).search(new SimpleQuery(0));
assertEquals("Failed calling connection '2' in searcher 'test' for query 'NULL': Connection failed",
r.hits().getError().getDetailedMessage());
@@ -134,7 +134,7 @@ public class ClusteredConnectionTestCase {
private String id;
- private boolean inService=true;
+ private boolean inService = true;
public Connection(String id) {
this.id=id;
@@ -142,12 +142,12 @@ public class ClusteredConnectionTestCase {
/** This is used for both fill, pings and queries */
public String getResponse() {
- if (!inService) throw new RuntimeException("Connection failed");
+ if ( ! inService) throw new RuntimeException("Connection failed");
return id;
}
public void setInService(boolean inservice) {
- this.inService=inservice;
+ this.inService = inservice;
}
public String toString() {
@@ -164,25 +164,25 @@ public class ClusteredConnectionTestCase {
private static class MyBackend extends ClusterSearcher<Connection> {
public MyBackend(ComponentId componentId, List<Connection> connections) {
- super(componentId,connections,false);
+ super(componentId,connections, false);
}
@Override
- public Result search(Query query,Execution execution,Connection connection) {
- Result result=new Result(query);
+ public Result search(Query query,Execution execution, Connection connection) {
+ Result result = new Result(query);
result.hits().add(new Hit("from:" + connection.getResponse()));
return result;
}
@Override
- public void fill(Result result,String summary,Execution execution,Connection connection) {
+ public void fill(Result result,String summary, Execution execution, Connection connection) {
result.hits().get(0).fields().put("filled",connection.getResponse());
}
@Override
public Pong ping(Ping ping,Connection connection) {
- Pong pong=new Pong();
- if (connection.getResponse()==null)
+ Pong pong = new Pong();
+ if (connection.getResponse() == null)
pong.addError(ErrorMessage.createBackendCommunicationError("No ping response from '" + connection + "'"));
return pong;
}
@@ -203,6 +203,11 @@ public class ClusteredConnectionTestCase {
return hashValue;
}
+ @Override
+ public long getTimeout() {
+ return 5000;
+ }
+
}
}