summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-01-25 13:08:50 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-01-25 13:08:50 +0100
commit3ef73bbd5e2a972344f49705906f42f9a3703981 (patch)
tree43157f1faef43114313bb82592a06c8d460710a1
parent140a13fb1820e08fe2f279e7644eee5a851adf3c (diff)
Adjust expected remaining time since timeout is now dynamically adjusted.
-rwxr-xr-xvespaclient-container-plugin/src/test/java/com/yahoo/storage/searcher/GetSearcherTestCase.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/storage/searcher/GetSearcherTestCase.java b/vespaclient-container-plugin/src/test/java/com/yahoo/storage/searcher/GetSearcherTestCase.java
index 3dd9b5526d7..8da09bc78ad 100755
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/storage/searcher/GetSearcherTestCase.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/storage/searcher/GetSearcherTestCase.java
@@ -259,7 +259,7 @@ public class GetSearcherTestCase {
public void testConfig() throws Exception {
DocumentSessionFactory factory = new DocumentSessionFactory(docType);
GetSearcher searcher = new GetSearcher(new FeedContext(
- new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(458).route("route66").retryenabled(false)), defLoadTypeCfg),
+ new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(58).route("route66").retryenabled(false)), defLoadTypeCfg),
factory, docMan, new ClusterList(), new NullFeedMetric()));
Chain<Searcher> searchChain = new Chain<>(searcher);
@@ -275,13 +275,13 @@ public class GetSearcherTestCase {
assertEquals("[all]", gdm.getFieldSet());
assertEquals(Route.parse("route66"), gdm.getRoute());
assertFalse(gdm.getRetryEnabled());
- assertEquals(458000, gdm.getTimeRemaining());
+ assertTrue(58000 >= gdm.getTimeRemaining());
}
}
@Test
public void testConfigChanges() throws Exception {
- String config = "raw:timeout 458\nroute \"riksveg18\"\nretryenabled true";
+ String config = "raw:timeout 37\nroute \"riksveg18\"\nretryenabled true";
DocumentSessionFactory factory = new DocumentSessionFactory(docType);
GetSearcher searcher = new GetSearcher(new FeedContext(
new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(58).route("riksveg18").retryenabled(true)),
@@ -385,6 +385,7 @@ public class GetSearcherTestCase {
Result result = new Execution(searchChain, Execution.Context.createContextStub()).search(
newQuery("?id[0]=userdoc:kittens:1:2&id[1]=userdoc:kittens:3:4&priority=LOW_2&route=highwaytohell&timeout=123"));
+ long lastTimeout = 123000;
assertEquals(2, factory.messages.size());
{
Message m = factory.messages.get(0);
@@ -395,7 +396,8 @@ public class GetSearcherTestCase {
assertEquals("[all]", gdm.getFieldSet());
assertEquals(DocumentProtocol.Priority.LOW_2, gdm.getPriority());
assertEquals(Route.parse("highwaytohell"), gdm.getRoute());
- assertEquals(123000, gdm.getTimeRemaining());
+ assertTrue(lastTimeout >= gdm.getTimeRemaining());
+ lastTimeout = gdm.getTimeRemaining();
}
{
@@ -407,7 +409,7 @@ public class GetSearcherTestCase {
assertEquals("[all]", gdm.getFieldSet());
assertEquals(DocumentProtocol.Priority.LOW_2, gdm.getPriority());
assertEquals(Route.parse("highwaytohell"), gdm.getRoute());
- assertEquals(123000, gdm.getTimeRemaining());
+ assertTrue(lastTimeout >= gdm.getTimeRemaining());
}
}