aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject git commit: Decouple initial scheduling delay from first scheduling penalty.
Date Sat, 18 Oct 2014 00:21:40 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 5c378ac21 -> 233e75b76


Decouple initial scheduling delay from first scheduling penalty.

Bugs closed: AURORA-868

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


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

Branch: refs/heads/master
Commit: 233e75b76ce090992d2389d1ed74d1b2351ed5a8
Parents: 5c378ac
Author: Joshua Cohen <jcohen@twopensource.com>
Authored: Fri Oct 17 17:18:21 2014 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Fri Oct 17 17:18:21 2014 -0700

----------------------------------------------------------------------
 .../aurora/scheduler/async/AsyncModule.java     | 24 ++++++---
 .../aurora/scheduler/async/TaskGroups.java      | 20 ++++++--
 .../aurora/scheduler/async/TaskGroupsTest.java  | 25 +++++++---
 .../scheduler/async/TaskSchedulerTest.java      | 51 ++++++++++----------
 .../scheduler/http/JettyServerModuleTest.java   |  7 ++-
 5 files changed, 82 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/233e75b7/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java b/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
index c8f7f99..90b26e5 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java
@@ -83,15 +83,22 @@ public class AsyncModule extends AbstractModule {
       Arg.create(Amount.of(5L, Time.MINUTES));
 
   @Positive
-  @CmdLine(name = "initial_schedule_delay",
-      help = "Initial amount of time to wait before attempting to schedule a PENDING task.")
-  private static final Arg<Amount<Long, Time>> INITIAL_SCHEDULE_DELAY =
+  @CmdLine(name = "first_schedule_delay",
+      help = "Initial amount of time to wait before first attempting to schedule a PENDING
task.")
+  private static final Arg<Amount<Long, Time>> FIRST_SCHEDULE_DELAY =
       Arg.create(Amount.of(1L, Time.MILLISECONDS));
 
-  @CmdLine(name = "max_schedule_delay",
+  @Positive
+  @CmdLine(name = "initial_schedule_penalty",
+      help = "Initial amount of time to wait before attempting to schedule a task that has
failed"
+          + " to schedule.")
+  private static final Arg<Amount<Long, Time>> INITIAL_SCHEDULE_PENALTY =
+      Arg.create(Amount.of(1L, Time.SECONDS));
+
+  @CmdLine(name = "max_schedule_penalty",
       help = "Maximum delay between attempts to schedule a PENDING tasks.")
-  private static final Arg<Amount<Long, Time>> MAX_SCHEDULE_DELAY =
-      Arg.create(Amount.of(30L, Time.SECONDS));
+  private static final Arg<Amount<Long, Time>> MAX_SCHEDULE_PENALTY =
+      Arg.create(Amount.of(1L, Time.MINUTES));
 
   @CmdLine(name = "min_offer_hold_time",
       help = "Minimum amount of time to hold a resource offer before declining.")
@@ -230,7 +237,10 @@ public class AsyncModule extends AbstractModule {
       @Override
       protected void configure() {
         bind(TaskGroupsSettings.class).toInstance(new TaskGroupsSettings(
-            new TruncatedBinaryBackoff(INITIAL_SCHEDULE_DELAY.get(), MAX_SCHEDULE_DELAY.get()),
+            FIRST_SCHEDULE_DELAY.get(),
+            new TruncatedBinaryBackoff(
+                INITIAL_SCHEDULE_PENALTY.get(),
+                MAX_SCHEDULE_PENALTY.get()),
             RateLimiter.create(MAX_SCHEDULE_ATTEMPTS_PER_SEC.get())));
 
         bind(RescheduleCalculatorImpl.RescheduleCalculatorSettings.class)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/233e75b7/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java b/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
index 8fb75b0..8cd6c96 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
@@ -23,6 +23,7 @@ import javax.inject.Inject;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
@@ -68,6 +69,7 @@ public class TaskGroups implements EventSubscriber {
   private final ConcurrentMap<GroupKey, TaskGroup> groups = Maps.newConcurrentMap();
   private final ScheduledExecutorService executor;
   private final TaskScheduler taskScheduler;
+  private final long firstScheduleDelay;
   private final BackoffStrategy backoff;
   private final RescheduleCalculator rescheduleCalculator;
 
@@ -77,10 +79,16 @@ public class TaskGroups implements EventSubscriber {
       new SlidingStats("scheduled_task_penalty", "ms");
 
   public static class TaskGroupsSettings {
+    private final Amount<Long, Time> firstScheduleDelay;
     private final BackoffStrategy taskGroupBackoff;
     private final RateLimiter rateLimiter;
 
-    public TaskGroupsSettings(BackoffStrategy taskGroupBackoff, RateLimiter rateLimiter)
{
+    public TaskGroupsSettings(
+        Amount<Long, Time> firstScheduleDelay,
+        BackoffStrategy taskGroupBackoff,
+        RateLimiter rateLimiter) {
+
+      this.firstScheduleDelay = requireNonNull(firstScheduleDelay);
       this.taskGroupBackoff = requireNonNull(taskGroupBackoff);
       this.rateLimiter = requireNonNull(rateLimiter);
     }
@@ -95,6 +103,7 @@ public class TaskGroups implements EventSubscriber {
 
     this(
         createThreadPool(shutdownRegistry),
+        settings.firstScheduleDelay,
         settings.taskGroupBackoff,
         settings.rateLimiter,
         taskScheduler,
@@ -104,14 +113,19 @@ public class TaskGroups implements EventSubscriber {
   @VisibleForTesting
   TaskGroups(
       final ScheduledExecutorService executor,
+      final Amount<Long, Time> firstScheduleDelay,
       final BackoffStrategy backoff,
       final RateLimiter rateLimiter,
       final TaskScheduler taskScheduler,
       final RescheduleCalculator rescheduleCalculator) {
 
+    requireNonNull(firstScheduleDelay);
+    Preconditions.checkArgument(firstScheduleDelay.getValue() > 0);
+
     this.executor = requireNonNull(executor);
     requireNonNull(rateLimiter);
     requireNonNull(taskScheduler);
+    this.firstScheduleDelay = firstScheduleDelay.as(Time.MILLISECONDS);
     this.backoff = requireNonNull(backoff);
     this.rescheduleCalculator = requireNonNull(rescheduleCalculator);
 
@@ -145,7 +159,7 @@ public class TaskGroups implements EventSubscriber {
             scheduledTaskPenalties.accumulate(group.getPenaltyMs());
             group.remove(taskId.get());
             if (group.hasMore()) {
-              penaltyMs = backoff.calculateBackoffMs(0);
+              penaltyMs = firstScheduleDelay;
             }
           } else {
             penaltyMs = backoff.calculateBackoffMs(group.getPenaltyMs());
@@ -191,7 +205,7 @@ public class TaskGroups implements EventSubscriber {
       if (existing == null) {
         long penaltyMs;
         if (stateChange.isTransition()) {
-          penaltyMs = backoff.calculateBackoffMs(0);
+          penaltyMs = firstScheduleDelay;
         } else {
           penaltyMs = rescheduleCalculator.getStartupScheduleDelayMs(task);
         }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/233e75b7/src/test/java/org/apache/aurora/scheduler/async/TaskGroupsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/async/TaskGroupsTest.java b/src/test/java/org/apache/aurora/scheduler/async/TaskGroupsTest.java
index efdde15..1d84496 100644
--- a/src/test/java/org/apache/aurora/scheduler/async/TaskGroupsTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/async/TaskGroupsTest.java
@@ -18,6 +18,9 @@ import java.util.concurrent.ScheduledFuture;
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.util.concurrent.RateLimiter;
+
+import com.twitter.common.quantity.Amount;
+import com.twitter.common.quantity.Time;
 import com.twitter.common.testing.easymock.EasyMockTest;
 import com.twitter.common.util.BackoffStrategy;
 
@@ -44,11 +47,12 @@ import static org.easymock.EasyMock.expectLastCall;
 
 public class TaskGroupsTest extends EasyMockTest {
 
+  private static final long FIRST_SCHEDULE_DELAY_MS = 1L;
+
   private ScheduledExecutorService executor;
   private BackoffStrategy backoffStrategy;
   private TaskScheduler taskScheduler;
   private RateLimiter rateLimiter;
-  private RescheduleCalculator rescheduleCalculator;
 
   private TaskGroups taskGroups;
 
@@ -58,19 +62,21 @@ public class TaskGroupsTest extends EasyMockTest {
     backoffStrategy = createMock(BackoffStrategy.class);
     taskScheduler = createMock(TaskScheduler.class);
     rateLimiter = createMock(RateLimiter.class);
-    rescheduleCalculator = createMock(RescheduleCalculator.class);
     taskGroups = new TaskGroups(
         executor,
+        Amount.of(FIRST_SCHEDULE_DELAY_MS, Time.MILLISECONDS),
         backoffStrategy,
         rateLimiter,
         taskScheduler,
-        rescheduleCalculator);
+        createMock(RescheduleCalculator.class));
   }
 
   @Test
-  public void testEvaluatedImmediately() {
-    expect(backoffStrategy.calculateBackoffMs(0)).andReturn(0L);
-    executor.schedule(EasyMock.<Runnable>anyObject(), EasyMock.eq(0L), EasyMock.eq(MILLISECONDS));
+  public void testEvaluatedAfterFirstSchedulePenalty() {
+    executor.schedule(
+        EasyMock.<Runnable>anyObject(),
+        EasyMock.eq(FIRST_SCHEDULE_DELAY_MS),
+        EasyMock.eq(MILLISECONDS));
     expectLastCall().andAnswer(new IAnswer<ScheduledFuture<Void>>() {
       @Override
       public ScheduledFuture<Void> answer() {
@@ -88,7 +94,10 @@ public class TaskGroupsTest extends EasyMockTest {
 
   private Capture<Runnable> expectEvaluate() {
     Capture<Runnable> capture = createCapture();
-    executor.schedule(EasyMock.capture(capture), EasyMock.eq(0L), EasyMock.eq(MILLISECONDS));
+    executor.schedule(
+        EasyMock.capture(capture),
+        EasyMock.eq(FIRST_SCHEDULE_DELAY_MS),
+        EasyMock.eq(MILLISECONDS));
     expectLastCall().andReturn(null);
     return capture;
   }
@@ -97,7 +106,6 @@ public class TaskGroupsTest extends EasyMockTest {
   public void testTaskDeletedBeforeEvaluating() {
     final IScheduledTask task = makeTask("a");
 
-    expect(backoffStrategy.calculateBackoffMs(0)).andReturn(0L).atLeastOnce();
     Capture<Runnable> evaluate = expectEvaluate();
 
     expect(rateLimiter.acquire()).andReturn(0D);
@@ -112,6 +120,7 @@ public class TaskGroupsTest extends EasyMockTest {
         return false;
       }
     });
+    expect(backoffStrategy.calculateBackoffMs(FIRST_SCHEDULE_DELAY_MS)).andReturn(0L);
 
     control.replay();
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/233e75b7/src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerTest.java b/src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerTest.java
index 9970948..919c79e 100644
--- a/src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/async/TaskSchedulerTest.java
@@ -85,6 +85,8 @@ import static org.junit.Assert.assertEquals;
  */
 public class TaskSchedulerTest extends EasyMockTest {
 
+  private static final long FIRST_SCHEDULE_DELAY_MS = 1L;
+
   private static final Offer OFFER_A = Offers.makeOffer("OFFER_A", "HOST_A");
   private static final Offer OFFER_B = Offers.makeOffer("OFFER_B", "HOST_B");
   private static final Offer OFFER_C = Offers.makeOffer("OFFER_C", "HOST_C");
@@ -140,6 +142,7 @@ public class TaskSchedulerTest extends EasyMockTest {
         clock);
     taskGroups = new TaskGroups(
         executor,
+        Amount.of(FIRST_SCHEDULE_DELAY_MS, Time.MILLISECONDS),
         retryStrategy,
         RateLimiter.create(100),
         scheduler,
@@ -192,10 +195,6 @@ public class TaskSchedulerTest extends EasyMockTest {
     return expectTaskRetryIn(nextPenaltyMs);
   }
 
-  private Capture<Runnable> expectTaskGroupBackoff(long nextPenaltyMs) {
-    return expectTaskGroupBackoff(0, nextPenaltyMs);
-  }
-
   @Test
   public void testNoTasks() {
     expectAnyMaintenanceCalls();
@@ -210,8 +209,8 @@ public class TaskSchedulerTest extends EasyMockTest {
 
   @Test
   public void testNoOffers() {
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
-    expectTaskGroupBackoff(10, 20);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
+    expectTaskGroupBackoff(FIRST_SCHEDULE_DELAY_MS, 10);
     expect(preemptor.findPreemptionSlotFor("a", emptyJob)).andReturn(Optional.<String>absent());
 
     replayAndCreateScheduler();
@@ -260,7 +259,7 @@ public class TaskSchedulerTest extends EasyMockTest {
 
   @Test
   public void testTaskMissing() {
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     replayAndCreateScheduler();
 
@@ -276,16 +275,16 @@ public class TaskSchedulerTest extends EasyMockTest {
     IScheduledTask task = makeTask("a", PENDING);
     TaskInfo mesosTask = makeTaskInfo(task);
 
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob)).andReturn(Optional.<TaskInfo>absent());
     expect(preemptor.findPreemptionSlotFor("a", emptyJob)).andReturn(Optional.<String>absent());
 
-    Capture<Runnable> timeoutCapture2 = expectTaskGroupBackoff(10, 20);
+    Capture<Runnable> timeoutCapture2 = expectTaskGroupBackoff(FIRST_SCHEDULE_DELAY_MS,
10);
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob)).andReturn(Optional.of(mesosTask));
     driver.launchTask(OFFER_A.getId(), mesosTask);
 
-    Capture<Runnable> timeoutCapture3 = expectTaskGroupBackoff(10);
-    expectTaskGroupBackoff(10, 20);
+    Capture<Runnable> timeoutCapture3 = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
+    expectTaskGroupBackoff(FIRST_SCHEDULE_DELAY_MS, 10);
     expect(preemptor.findPreemptionSlotFor("b", emptyJob)).andReturn(Optional.<String>absent());
 
     replayAndCreateScheduler();
@@ -309,7 +308,7 @@ public class TaskSchedulerTest extends EasyMockTest {
         .setSlaveId(SlaveID.newBuilder().setValue("slaveId"))
         .build();
 
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
     expectAnyMaintenanceCalls();
     expectOfferDeclineIn(10);
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob)).andReturn(Optional.of(mesosTask));
@@ -338,13 +337,13 @@ public class TaskSchedulerTest extends EasyMockTest {
         .setSlaveId(SlaveID.newBuilder().setValue("slaveId"))
         .build();
 
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
     expectAnyMaintenanceCalls();
     expectOfferDeclineIn(10);
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob))
         .andThrow(new StorageException("Injected failure."));
 
-    Capture<Runnable> timeoutCapture2 = expectTaskGroupBackoff(10, 20);
+    Capture<Runnable> timeoutCapture2 = expectTaskGroupBackoff(FIRST_SCHEDULE_DELAY_MS,
10);
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob)).andReturn(Optional.of(mesosTask));
     driver.launchTask(OFFER_A.getId(), mesosTask);
     expectLastCall();
@@ -361,14 +360,14 @@ public class TaskSchedulerTest extends EasyMockTest {
   public void testExpiration() {
     IScheduledTask task = makeTask("a", PENDING);
 
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
     Capture<Runnable> offerExpirationCapture = expectOfferDeclineIn(10);
     expectAnyMaintenanceCalls();
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob)).andReturn(Optional.<TaskInfo>absent());
-    Capture<Runnable> timeoutCapture2 = expectTaskGroupBackoff(10, 20);
+    Capture<Runnable> timeoutCapture2 = expectTaskGroupBackoff(FIRST_SCHEDULE_DELAY_MS,
10);
     expect(preemptor.findPreemptionSlotFor("a", emptyJob)).andReturn(Optional.<String>absent());
     driver.declineOffer(OFFER_A.getId());
-    expectTaskGroupBackoff(20, 30);
+    expectTaskGroupBackoff(10, 20);
     expect(preemptor.findPreemptionSlotFor("a", emptyJob)).andReturn(Optional.<String>absent());
 
     replayAndCreateScheduler();
@@ -431,13 +430,13 @@ public class TaskSchedulerTest extends EasyMockTest {
     TaskInfo mesosTaskA = makeTaskInfo(taskA);
     expect(assigner.maybeAssign(OFFER_A, taskA, emptyJob)).andReturn(Optional.of(mesosTaskA));
     driver.launchTask(OFFER_A.getId(), mesosTaskA);
-    Capture<Runnable> captureA = expectTaskGroupBackoff(10);
+    Capture<Runnable> captureA = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     IScheduledTask taskB = makeTask("B", PENDING);
     TaskInfo mesosTaskB = makeTaskInfo(taskB);
     expect(assigner.maybeAssign(OFFER_B, taskB, emptyJob)).andReturn(Optional.of(mesosTaskB));
     driver.launchTask(OFFER_B.getId(), mesosTaskB);
-    Capture<Runnable> captureB = expectTaskGroupBackoff(10);
+    Capture<Runnable> captureB = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     replayAndCreateScheduler();
 
@@ -466,13 +465,13 @@ public class TaskSchedulerTest extends EasyMockTest {
     TaskInfo mesosTaskA = makeTaskInfo(taskA);
     expect(assigner.maybeAssign(OFFER_B, taskA, emptyJob)).andReturn(Optional.of(mesosTaskA));
     driver.launchTask(OFFER_B.getId(), mesosTaskA);
-    Capture<Runnable> captureA = expectTaskGroupBackoff(10);
+    Capture<Runnable> captureA = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     IScheduledTask taskB = makeTask("B", PENDING);
     TaskInfo mesosTaskB = makeTaskInfo(taskB);
     expect(assigner.maybeAssign(OFFER_C, taskB, emptyJob)).andReturn(Optional.of(mesosTaskB));
     driver.launchTask(OFFER_C.getId(), mesosTaskB);
-    Capture<Runnable> captureB = expectTaskGroupBackoff(10);
+    Capture<Runnable> captureB = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     replayAndCreateScheduler();
 
@@ -531,14 +530,14 @@ public class TaskSchedulerTest extends EasyMockTest {
     expectOfferDeclineIn(10);
     expectOfferDeclineIn(10);
 
-    Capture<Runnable> timeoutA = expectTaskGroupBackoff(10);
-    Capture<Runnable> timeoutB = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutA = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
+    Capture<Runnable> timeoutB = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     Capture<IScheduledTask> firstScheduled = expectTaskScheduled(jobA0);
     Capture<IScheduledTask> secondScheduled = expectTaskScheduled(jobB0);
 
     // Expect another watch of the task group for job A.
-    expectTaskGroupBackoff(10);
+    expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
 
     replayAndCreateScheduler();
 
@@ -564,9 +563,9 @@ public class TaskSchedulerTest extends EasyMockTest {
 
     final IScheduledTask task = makeTask("a", PENDING);
 
-    Capture<Runnable> timeoutCapture = expectTaskGroupBackoff(10);
+    Capture<Runnable> timeoutCapture = expectTaskRetryIn(FIRST_SCHEDULE_DELAY_MS);
     expect(assigner.maybeAssign(OFFER_A, task, emptyJob)).andReturn(Optional.<TaskInfo>absent());
-    expectTaskGroupBackoff(10, 20);
+    expectTaskGroupBackoff(FIRST_SCHEDULE_DELAY_MS, 20);
     expect(preemptor.findPreemptionSlotFor("a", emptyJob)).andReturn(Optional.<String>absent());
 
     replayAndCreateScheduler();

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/233e75b7/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
index 1233b25..4d58240 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
@@ -37,6 +37,8 @@ import com.twitter.common.application.modules.StatsModule;
 import com.twitter.common.base.Command;
 import com.twitter.common.net.pool.DynamicHostSet;
 import com.twitter.common.net.pool.DynamicHostSet.HostChangeMonitor;
+import com.twitter.common.quantity.Amount;
+import com.twitter.common.quantity.Time;
 import com.twitter.common.testing.easymock.EasyMockTest;
 import com.twitter.common.util.BackoffStrategy;
 import com.twitter.thrift.ServiceInstance;
@@ -101,7 +103,10 @@ public abstract class JettyServerModuleTest extends EasyMockTest {
                 .setThriftAPIVersion(100)
                 .setStatsUrlPrefix("none")));
             bind(TaskGroupsSettings.class).toInstance(
-                new TaskGroupsSettings(bindMock(BackoffStrategy.class), RateLimiter.create(1000)));
+                new TaskGroupsSettings(
+                    Amount.of(1L, Time.MILLISECONDS),
+                    bindMock(BackoffStrategy.class),
+                    RateLimiter.create(1000)));
 
             bind(new TypeLiteral<DynamicHostSet<ServiceInstance>>() { }).toInstance(schedulers);
             thrift = bindMock(AuroraAdmin.Iface.class);


Mime
View raw message