diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-05-10 23:40:43 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-05-10 23:40:43 +0200 |
commit | 837e33533ba3c109aeb48f2cfcc10d0b28a8a1b8 (patch) | |
tree | 8d675b966ea8b7461f484a400ac7d9d8adf7d0cd /container-search/src/test/java/com/yahoo/search/searchchain | |
parent | e9bc22ad954be93f431cd261a203f520b2d2318c (diff) |
Remove some dead code
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/searchchain')
2 files changed, 13 insertions, 7 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionTestCase.java b/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionTestCase.java index 9ea637a5554..3bae38907eb 100644 --- a/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionTestCase.java @@ -146,6 +146,7 @@ public class AsyncExecutionTestCase { } + @Test public void testAsyncExecutionTimeout() { Chain<Searcher> chain = new Chain<>(new Searcher() { @Override diff --git a/container-search/src/test/java/com/yahoo/search/searchchain/test/VespaAsyncSearcherTest.java b/container-search/src/test/java/com/yahoo/search/searchchain/test/VespaAsyncSearcherTest.java index 567b73783b1..77a515b458d 100644 --- a/container-search/src/test/java/com/yahoo/search/searchchain/test/VespaAsyncSearcherTest.java +++ b/container-search/src/test/java/com/yahoo/search/searchchain/test/VespaAsyncSearcherTest.java @@ -14,26 +14,32 @@ import java.util.ArrayList; import java.util.List; /** - * Externally provided test for async execution of search chains. + * Tests async execution of search chains. * * @author Peter Thomas + * @author bratseth */ public class VespaAsyncSearcherTest { private static class FirstSearcher extends Searcher { @Override - public Result search(Query query, Execution exctn) { + public Result search(Query query, Execution execution) { int count = 10; List<FutureResult> futures = new ArrayList<>(count); for (int i = 0; i < count; i++) { - Query subQuery = new Query(); - FutureResult future = new AsyncExecution(exctn) - .search(subQuery); + Query subQuery = query.clone(); + FutureResult future = new AsyncExecution(execution).search(subQuery); futures.add(future); } AsyncExecution.waitForAll(futures, 10 * 60 * 1000); - return new Result(query); + Result combinedResult = new Result(query); + for (FutureResult resultFuture : futures) { + Result result = resultFuture.get(); + combinedResult.mergeWith(result); + combinedResult.hits().add(result.hits()); + } + return combinedResult; } } @@ -52,7 +58,6 @@ public class VespaAsyncSearcherTest { Chain<Searcher> chain = new Chain<>(new FirstSearcher(), new SecondSearcher()); Execution execution = new Execution(chain, Execution.Context.createContextStub(null)); Query query = new Query(); - // fails with exception on old versions execution.search(query); } |