diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-07 17:00:28 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-07 17:05:04 +0200 |
commit | e8f2842df4e486af6b31e2ffbc1d5569b8d26850 (patch) | |
tree | b4aa7928ebf4ab6dc85f039325138857a24b4eaa /container-search/src/test/java/com/yahoo/search/query | |
parent | 6cd3e5387169803041c5628178181ee15e7b929c (diff) |
- Use the default threadpool for federation.
- Move test classes into the same package as the code to avoid making test only methods public.
- Deprecate old AsyncExecution.search/fill methods and let them run in its own thread.
There should be no external usage of this class.
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/query')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/query/context/test/ConcurrentTraceTestCase.java | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/context/test/ConcurrentTraceTestCase.java b/container-search/src/test/java/com/yahoo/search/query/context/test/ConcurrentTraceTestCase.java deleted file mode 100644 index c8aac27da1d..00000000000 --- a/container-search/src/test/java/com/yahoo/search/query/context/test/ConcurrentTraceTestCase.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.query.context.test; - -import java.util.ArrayList; -import java.util.List; - -import com.yahoo.component.chain.Chain; - -import com.yahoo.search.Query; -import com.yahoo.search.Result; -import com.yahoo.search.Searcher; -import com.yahoo.search.searchchain.AsyncExecution; -import com.yahoo.search.searchchain.Execution; -import com.yahoo.search.searchchain.FutureResult; - -/** - * Checks it's OK adding more traces to an instance which is being rendered. - * - * @author <a href="arnebef@yahoo-inc.com">Arne Bergene Fossaa</a> - */ -@SuppressWarnings("deprecation") -public class ConcurrentTraceTestCase { - class TraceSearcher extends Searcher { - - @Override - public Result search(Query query, Execution execution) { - for(int i = 0;i<1000;i++) { - query.trace("Trace", false, 1); - try { - Thread.sleep(1); - } catch (InterruptedException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - } - return execution.search(query); - } - } - - class AsyncSearcher extends Searcher { - - @Override - public Result search(Query query, Execution execution) { - Chain<Searcher> chain = new Chain<>(new TraceSearcher()); - - Result result = new Result(query); - List<FutureResult> futures = new ArrayList<>(); - for(int i = 0; i < 100; i++) { - futures.add(new AsyncExecution(chain, execution).searchAndFill(query)); - } - AsyncExecution.waitForAll(futures, 10); - return result; - } - - } - -} |