aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java')
-rw-r--r--container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java b/container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java
index eb461d6211f..4aeacb92506 100644
--- a/container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java
+++ b/container-search/src/test/java/com/yahoo/search/handler/SearchHandlerTest.java
@@ -1,4 +1,4 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.handler;
import com.yahoo.container.Container;
@@ -36,7 +36,13 @@ import java.net.URI;
import java.util.concurrent.Executors;
import static com.yahoo.yolean.Exceptions.uncheckInterrupted;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* @author bratseth
@@ -109,6 +115,12 @@ public class SearchHandlerTest {
}
@Test
+ void testTimeout() {
+ // 1µs is truncated to 0ms, so this will always time out.
+ assertTrue(driver.sendRequest("http://localhost?query=test&timeout=1µs").readAll().contains("Timed out"));
+ }
+
+ @Test
synchronized void testPluginError() {
assertTrue(driver.sendRequest("http://localhost?query=test&searchChain=exceptionInPlugin").readAll().contains("NullPointerException"));
}