From b5b32dbcb48bc8c304bbfa107ad802ba3b7d8493 Mon Sep 17 00:00:00 2001 From: Himanshu Gupta Date: Sat, 21 Mar 2015 19:51:13 -0500 Subject: [PATCH] in test explicitly setting maxThreads for ProxyServlet to work around https://tickets.puppetlabs.com/browse/TK-152 --- .../AsyncQueryForwardingServletTest.java | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java b/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java index 097358645c3..a9e3191efe5 100644 --- a/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java +++ b/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java @@ -154,33 +154,34 @@ public class AsyncQueryForwardingServletTest extends BaseJettyTest } }; - root.addServlet( - new ServletHolder( - new AsyncQueryForwardingServlet( - injector.getInstance(ObjectMapper.class), - injector.getInstance(Key.get(ObjectMapper.class, Smile.class)), - hostFinder, - injector.getProvider(org.eclipse.jetty.client.HttpClient.class), - injector.getInstance(DruidHttpClientConfig.class), - new NoopServiceEmitter(), - new RequestLogger() - { - @Override - public void log(RequestLogLine requestLogLine) throws IOException - { - // noop - } - } - ) { + ServletHolder holder = new ServletHolder( + new AsyncQueryForwardingServlet( + injector.getInstance(ObjectMapper.class), + injector.getInstance(Key.get(ObjectMapper.class, Smile.class)), + hostFinder, + injector.getProvider(org.eclipse.jetty.client.HttpClient.class), + injector.getInstance(DruidHttpClientConfig.class), + new NoopServiceEmitter(), + new RequestLogger() + { @Override - protected URI rewriteURI(HttpServletRequest request) + public void log(RequestLogLine requestLogLine) throws IOException { - URI uri = super.rewriteURI(request); - return URI.create(uri.toString().replace("/proxy", "")); + // noop } } - ), "/proxy/*" - ); + ) + { + @Override + protected URI rewriteURI(HttpServletRequest request) + { + URI uri = super.rewriteURI(request); + return URI.create(uri.toString().replace("/proxy", "")); + } + }); + //NOTE: explicit maxThreads to workaround https://tickets.puppetlabs.com/browse/TK-152 + holder.setInitParameter("maxThreads", "256"); + root.addServlet(holder, "/proxy/*"); JettyServerInitUtils.addExtensionFilters(root, injector); root.addFilter(JettyServerInitUtils.defaultAsyncGzipFilterHolder(), "/*", null); root.addFilter(GuiceFilter.class, "/slow/*", null);