aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject aurora git commit: HTTP server cleanup - shut down the server after unit tests, remove jetty bug workaround.
Date Thu, 17 Dec 2015 18:58:58 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 340d60464 -> 15195bd7d


HTTP server cleanup - shut down the server after unit tests, remove jetty bug workaround.

Reviewed at https://reviews.apache.org/r/41453/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/15195bd7
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/15195bd7
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/15195bd7

Branch: refs/heads/master
Commit: 15195bd7d722c8857d869fa0ce9af5a619184bd0
Parents: 340d604
Author: Bill Farner <wfarner@apache.org>
Authored: Thu Dec 17 10:58:55 2015 -0800
Committer: Bill Farner <wfarner@apache.org>
Committed: Thu Dec 17 10:58:55 2015 -0800

----------------------------------------------------------------------
 .../apache/aurora/scheduler/http/JettyServerModule.java |  4 ----
 .../apache/aurora/scheduler/http/AbstractJettyTest.java | 12 +++++++++---
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/15195bd7/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java b/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
index 838bfc9..277858b 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java
@@ -359,10 +359,6 @@ public class JettyServerModule extends AbstractModule {
 
     @Override
     protected void startUp() {
-      // N.B. we explicitly disable the resource cache here due to a bug serving content
out of the
-      // jar under the vagrant image. C.f. https://bugs.eclipse.org/bugs/show_bug.cgi?id=364936
-      Resource.setDefaultUseCaches(false);
-
       server = new Server();
       ServletContextHandler servletHandler =
           new ServletContextHandler(server, "/", ServletContextHandler.NO_SESSIONS);

http://git-wip-us.apache.org/repos/asf/aurora/blob/15195bd7/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java b/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
index 5768481..39f7188 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
@@ -13,6 +13,8 @@
  */
 package org.apache.aurora.scheduler.http;
 
+import java.util.concurrent.TimeUnit;
+
 import javax.servlet.ServletContextListener;
 import javax.ws.rs.core.MediaType;
 
@@ -91,7 +93,7 @@ public abstract class AbstractJettyTest extends EasyMockTest {
   @Before
   public void setUpBase() throws Exception {
     storage = new StorageTestUtil(this);
-    final DynamicHostSet<ServiceInstance> schedulers =
+    DynamicHostSet<ServiceInstance> schedulers =
         createMock(new Clazz<DynamicHostSet<ServiceInstance>>() { });
 
     injector = Guice.createInjector(
@@ -140,8 +142,12 @@ public abstract class AbstractJettyTest extends EasyMockTest {
   protected void replayAndStart() {
     control.replay();
     try {
-      injector.getInstance(Key.get(ServiceManagerIface.class, AppStartup.class))
-          .startAsync().awaitHealthy();
+      ServiceManagerIface service =
+          injector.getInstance(Key.get(ServiceManagerIface.class, AppStartup.class));
+      service.startAsync().awaitHealthy();
+      addTearDown(() -> {
+        service.stopAsync().awaitStopped(5L, TimeUnit.SECONDS);
+      });
     } catch (Exception e) {
       throw Throwables.propagate(e);
     }


Mime
View raw message