@Test public void testComputeScheduleDelayNoMax() { final ProgressiveDelay progressiveDelay = new ProgressiveDelay(15, 0); assertEquals(15, progressiveDelay.computeScheduleDelay(createBuild(false, null))); assertEquals(45, progressiveDelay .computeScheduleDelay(createBuild(true, createBuild(false, null)))); assertEquals(90, progressiveDelay.computeScheduleDelay( createBuild(true, createBuild(true, createBuild(false, null))))); }
@Override public int computeScheduleDelay(AbstractBuild failedBuild) { int n = 1; int delay = increment; Run r = failedBuild; while (r != null && r.getAction(NaginatorAction.class) != null) { r = r.getPreviousBuild(); n++; delay += n * increment; } return max <= 0 ? delay : min(delay, max); }
ProgressiveDelay extends ScheduleDelay { @Override public int computeScheduleDelay(AbstractBuild failedBuild) { int n = 1; int delay = increment; Run r = failedBuild; while (r != null && r.getAction(NaginatorAction.class) != null) { r = r.getPreviousBuild(); n++; delay += n * increment; } return max <= 0 ? delay : min(delay, max); } }
ProgressiveDelay extends ScheduleDelay { @Override public int computeScheduleDelay(AbstractBuild failedBuild) { int n = 1; int delay = increment; Run r = failedBuild; while (r != null && r.getAction(NaginatorAction.class) != null) { r = r.getPreviousBuild(); n++; delay += n * increment; } return max <= 0 ? delay : min(delay, max); } @DataBoundConstructor  ProgressiveDelay(int increment, int max); }
ProgressiveDelay extends ScheduleDelay { @Override public int computeScheduleDelay(AbstractBuild failedBuild) { int n = 1; int delay = increment; Run r = failedBuild; while (r != null && r.getAction(NaginatorAction.class) != null) { r = r.getPreviousBuild(); n++; delay += n * increment; } return max <= 0 ? delay : min(delay, max); } @DataBoundConstructor  ProgressiveDelay(int increment, int max); int getIncrement(); int getMax(); @Override int computeScheduleDelay(AbstractBuild failedBuild); }
ProgressiveDelay extends ScheduleDelay { @Override public int computeScheduleDelay(AbstractBuild failedBuild) { int n = 1; int delay = increment; Run r = failedBuild; while (r != null && r.getAction(NaginatorAction.class) != null) { r = r.getPreviousBuild(); n++; delay += n * increment; } return max <= 0 ? delay : min(delay, max); } @DataBoundConstructor  ProgressiveDelay(int increment, int max); int getIncrement(); int getMax(); @Override int computeScheduleDelay(AbstractBuild failedBuild);  }