aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2018-09-21 09:41:12 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-09-21 09:41:12 +0200
commit1c03478fe8f9f7c97b7a363763a72e4c37c5194b (patch)
tree15142dd5996d989ecda2c8602ec15e7e4d22bc9a /controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
parentadc3f3eaee4e53f5c1b68ccb22a943f0148b6f0e (diff)
Allow a change which has deployed to complete when blocked
Diffstat (limited to 'controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java25
1 files changed, 8 insertions, 17 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 3b381e21b27..b82855813ba 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
@@ -46,6 +46,7 @@ import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobTy
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.stagingTest;
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.systemTest;
import static java.time.temporal.ChronoUnit.MILLIS;
+import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -340,7 +341,7 @@ public class DeploymentTriggerTest {
tester.deployAndNotify(app, changedApplication, true, stagingTest);
readyJobsTrigger.run();
- assertEquals(0, tester.buildService().jobs().size());
+ assertEquals(emptyList(), tester.buildService().jobs());
tester.clock().advance(Duration.ofHours(2)); // ---------------- Exit block window: 20:30
tester.deploymentTrigger().triggerReadyJobs(); // Schedules staging test for the blocked production job(s)
@@ -380,27 +381,17 @@ public class DeploymentTriggerTest {
assertEquals((BuildJob.defaultBuildNumber + 1), tester.application(application.id()).outstandingChange().application().get().buildNumber().getAsLong());
tester.readyJobTrigger().maintain();
- assertTrue(tester.buildService().jobs().isEmpty());
+ // Platform upgrade keeps rolling, since it has already deployed in a production zone.
+ assertEquals(1, tester.buildService().jobs().size());
+ tester.deployAndNotify(application, applicationPackage, true, productionUsEast3);
+ assertEquals(emptyList(), tester.buildService().jobs());
+
- // New component triggers a full deployment of new application version, leaving platform versions alone.
+ // New component triggers a full deployment of new application version, but only after the upgrade is done.
tester.jobCompletion(component).application(application).nextBuildNumber().nextBuildNumber().uploadArtifact(applicationPackage).submit();
tester.deployAndNotify(application, applicationPackage, true, stagingTest);
tester.deployAndNotify(application, applicationPackage, true, systemTest);
tester.deployAndNotify(application, applicationPackage, true, productionUsWest1);
- tester.deployAndNotify(application, applicationPackage, true, systemTest);
- tester.deployAndNotify(application, applicationPackage, true, stagingTest);
- tester.deployAndNotify(application, applicationPackage, true, productionUsEast3);
- tester.deployAndNotify(application, applicationPackage, true, systemTest);
- tester.deployAndNotify(application, applicationPackage, true, stagingTest);
-
- // All tests are done for now, and only the platform change remains.
- assertTrue(tester.buildService().jobs().isEmpty());
- assertEquals(Change.of(v2), tester.application(application.id()).change());
-
- // Exiting block window, staging test is re-run for the last prod zone, which has the old platform.
- clock.advance(Duration.ofHours(1));
- tester.readyJobTrigger().maintain();
- tester.deployAndNotify(application, applicationPackage, true, stagingTest);
tester.deployAndNotify(application, applicationPackage, true, productionUsEast3);
assertFalse(tester.application(application.id()).change().isPresent());