summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2018-05-03 17:01:22 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-05-04 10:37:28 +0200
commit285e066bd1ae6fe0b1df33c79e98399c6ddbcc31 (patch)
treeade04f8a9d120f9bedb5ab5022b50c6168bc535f /controller-server
parentaa340a62decff7f0a0e583630e2ca2e895e2463d (diff)
Handle arbitrary order of triggering for parallel jobs
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java24
1 files changed, 13 insertions, 11 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 1c5e686fab1..5d3754661df 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
@@ -545,29 +545,31 @@ public class DeploymentTriggerTest {
assertEquals(v2, app.get().deployments().get(productionEuWest1.zone(main).get()).version());
assertEquals(v1, app.get().deployments().get(productionUsEast3.zone(main).get()).version());
- // New application version should run system and staging tests first against 6.2, then against 6.1.
+ // New application version should run system and staging tests against both 6.1 and 6.2, in no particular order.
tester.jobCompletion(component).application(application).nextBuildNumber().uploadArtifact(applicationPackage).submit();
- assertEquals(v2, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().platform());
+ Version firstTested = app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().platform();
+ assertEquals(firstTested, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().platform());
+
tester.deployAndNotify(application, empty(), true, systemTest);
- assertEquals(v2, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().platform());
tester.deployAndNotify(application, empty(), true, stagingTest);
- // Tests are not re-triggered, because eu-west-1 needs their success to trigger
- assertEquals(v2, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().platform());
- assertEquals(v2, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().platform());
+ // Tests are not re-triggered, because the jobs they were run for has not yet been triggered with the tested versions.
+ assertEquals(firstTested, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().platform());
+ assertEquals(firstTested, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().platform());
// Finish old runs of the production jobs, which fail.
tester.deployAndNotify(application, applicationPackage, false, productionEuWest1);
tester.deployAndNotify(application, applicationPackage, false, productionUsEast3);
- // New upgrade is already tested for eu-west-1, and tests may now test the upgrade for us-east-3
- assertEquals(v1, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().platform());
+ // New upgrade is already tested for one of the jobs, which has now been triggered, and tests may run for the other job.
+ assertNotEquals(firstTested, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().platform());
+ assertNotEquals(firstTested, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().platform());
tester.deployAndNotify(application, empty(), true, systemTest);
- assertEquals(v1, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().platform());
tester.deployAndNotify(application, empty(), true, stagingTest);
- tester.deployAndNotify(application, empty(), false, productionEuWest1);
- // The production job on version 6.2 fails and must retry -- this is OK, even though staging now has a different version.
+ // Both jobs fail again, and must be re-triggered -- this is ok, as they are both already triggered on their current targets.
+ tester.deployAndNotify(application, empty(), false, productionEuWest1);
+ tester.deployAndNotify(application, empty(), false, productionUsEast3);
tester.deployAndNotify(application, empty(), true, productionUsEast3);
tester.deployAndNotify(application, empty(), true, productionEuWest1);
assertFalse(app.get().change().isPresent());