summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2018-03-20 18:06:31 +0100
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-03-20 18:06:31 +0100
commite5e9296d6b5480623e85f6cb601c5228ded62e30 (patch)
tree6a90048b3b9bd75ce1cad78f659555a2dee670d6 /controller-server
parent9c8fbd98d7ca8756a6c24daaf70c244fa67531d5 (diff)
Expand the with next job logic
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
index 2dc90563580..33fb1b39bb7 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
@@ -23,6 +23,7 @@ import org.junit.Test;
import java.time.Duration;
import java.time.Instant;
+import java.util.Collections;
import java.util.Optional;
import java.util.function.Supplier;
@@ -395,9 +396,26 @@ public class DeploymentTriggerTest {
assertTrue(tester.deploymentQueue().jobs().isEmpty());
// Deploy the new application version, even though the platform version is already deployed in us-central-1.
- tester.deployCompletely(application, applicationPackage, BuildJob.defaultBuildNumber + 1);
+ // Let it fail in us-central-1 after deployment, so we can test this zone is later skipped.
+ tester.completeDeploymentWithError(application, applicationPackage, BuildJob.defaultBuildNumber + 1, productionUsCentral1);
+ tester.deploy(productionUsCentral1, application, Optional.empty(), false);
+
assertEquals(ApplicationVersion.from(BuildJob.defaultSourceRevision, BuildJob.defaultBuildNumber + 1),
app.get().deployments().get(ZoneId.from("prod.us-central-1")).applicationVersion());
+
+ // Exhaust the automatic retry.
+ tester.clock().advance(Duration.ofHours(1));
+ tester.deployAndNotify(application, Optional.empty(), false, true, productionUsCentral1);
+ assertTrue(tester.deploymentQueue().jobs().isEmpty());
+
+ // Let the ReadyJobTrigger get what it thinks is the next job -- should be the last job.
+ tester.readyJobTrigger().maintain();
+ assertEquals(Collections.singletonList(new BuildService.BuildJob(1, productionEuWest1.jobName())),
+ tester.deploymentQueue().jobs());
+ tester.deploy(productionEuWest1, application, Optional.empty(), false);
+ tester.deployAndNotify(application, Optional.empty(), false, true, productionEuWest1);
+ assertFalse(app.get().change().isPresent());
+ assertTrue(tester.deploymentQueue().jobs().isEmpty());
}
@Test