diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-05-24 15:02:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-24 15:02:20 +0200 |
commit | 8243644f3272799293a3fc09f29128079f7f0fba (patch) | |
tree | 54a6f4567c4a62ddf0137323e362e4788bdbd5dc /container-search/src/test | |
parent | f4f86814c95b08824a11ff4a872332dc7d88e91d (diff) | |
parent | 2200df4ffbdf7d8de9f671ef6168558c4362e191 (diff) |
Merge pull request #9546 from vespa-engine/bratseth/increase-test-timeout
Increase timeout
Diffstat (limited to 'container-search/src/test')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/cluster/test/ClusteredConnectionTestCase.java | 27 |
1 files changed, 16 insertions, 11 deletions
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; + } + } } |