summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-01-25 10:45:11 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-01-25 10:45:11 +0100
commit9c868d0c4c25488facd7843f12e07dfc6f2353b8 (patch)
tree7103cae94073350723fcca24a71bcea9e86ca4e7 /vespaclient-container-plugin/src
parentcfb78037fdc4eb22410b5ed13bf59225ac476ec4 (diff)
The http parameter &totaltimeout can be used to control the overall timeout.
If both timeouts are given the lower of the computed and the given &timeout is used per message. Setting &totaltimeout to a negative value enables a fixed timeout given to each message. This mimics todays broken behavior.
Diffstat (limited to 'vespaclient-container-plugin/src')
-rwxr-xr-xvespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/VespaFeedHandlerTestCase.java50
1 files changed, 49 insertions, 1 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/VespaFeedHandlerTestCase.java b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/VespaFeedHandlerTestCase.java
index 823f4b6f568..d1ed02209b2 100755
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/VespaFeedHandlerTestCase.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/VespaFeedHandlerTestCase.java
@@ -640,7 +640,7 @@ public class VespaFeedHandlerTestCase {
@Test
public void testOverrides() throws Exception {
setup(null);
- Result res = testFeed(xmlFilesPath + "test10b.xml", "feed?timeout=2.222&route=storage&priority=HIGH_2");
+ Result res = testFeed(xmlFilesPath + "test10b.xml", "feed?timeout=2.222&route=storage&priority=HIGH_2&totaltimeout=-1");
assertEquals(2, res.messages.size());
@@ -652,6 +652,54 @@ public class VespaFeedHandlerTestCase {
}
@Test
+ public void testTimeoutWithNoUpperBound() throws Exception {
+ setup(null);
+ Result res = testFeed(xmlFilesPath + "test10b.xml", "feed?timeout=2.222&totaltimeout=-1");
+
+ assertEquals(2, res.messages.size());
+
+ for (Message m : res.messages) {
+ assertEquals(2222, m.getTimeRemaining());
+ }
+ }
+
+ @Test
+ public void testTimeout() throws Exception {
+ setup(null);
+ Result res = testFeed(xmlFilesPath + "test10b.xml", "feed?timeout=2.222");
+
+ assertEquals(2, res.messages.size());
+
+ for (Message m : res.messages) {
+ assertTrue(2222 >= m.getTimeRemaining());
+ }
+ }
+
+ @Test
+ public void testTotalTimeout() throws Exception {
+ setup(null);
+ Result res = testFeed(xmlFilesPath + "test10b.xml", "feed?totaltimeout=2.222");
+
+ assertEquals(2, res.messages.size());
+
+ for (Message m : res.messages) {
+ assertTrue(2222 >= m.getTimeRemaining());
+ }
+ }
+
+ @Test
+ public void testTotalTimeoutAndNormalTimeout() throws Exception {
+ setup(null);
+ Result res = testFeed(xmlFilesPath + "test10b.xml", "feed?totaltimeout=1000&timeout=2.222");
+
+ assertEquals(2, res.messages.size());
+
+ for (Message m : res.messages) {
+ assertEquals(2222, m.getTimeRemaining());
+ }
+ }
+
+ @Test
public void testBogusPriority() throws Exception {
try {
setup(null);