diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2022-03-14 19:49:13 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2022-03-14 19:49:13 +0100 |
commit | 72e6cb8d0ad1cafa093c77aab8e35c1d3495d2b9 (patch) | |
tree | bdf3e38537ff4620b7bbc53e3590439abffdd575 | |
parent | 9c34ef02eeb0312bfc71490beb69d6dde4463123 (diff) |
No oustanding change tests with incompatible versions
3 files changed, 28 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java index b7394f556bc..f94b9f32088 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java @@ -322,15 +322,18 @@ public class DeploymentStatus { Optional<Deployment> deployment = deploymentFor(job); Optional<Version> existingPlatform = deployment.map(Deployment::version); Optional<ApplicationVersion> existingApplication = deployment.map(Deployment::applicationVersion); + boolean deployingCompatibilityChange = areIncompatible(existingPlatform, change.application()) + || areIncompatible(change.platform(), existingApplication); if (assumeUpgradesSucceed) { + if (deployingCompatibilityChange) // No eager tests for this. + return; + Change currentChange = application.require(instance).change(); Versions target = Versions.from(currentChange, application, deployment, systemVersion); existingPlatform = Optional.of(target.targetPlatform()); existingApplication = Optional.of(target.targetApplication()); } List<Job> toRun = new ArrayList<>(); - boolean deployingCompatibilityChange = areIncompatible(existingPlatform, change.application()) - || areIncompatible(change.platform(), existingApplication); List<Change> changes = deployingCompatibilityChange ? List.of(change) : changes(job, step, change); if (changes.isEmpty()) return; for (Change partial : changes) { diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java index bca4e2b09df..15a194d2ffa 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java @@ -189,6 +189,8 @@ public final class ControllerTester { public AthenzDbMock athenzDb() { return athenzDb; } + public InMemoryFlagSource flagSource() { return flagSource; } + public MemoryNameService nameService() { return serviceRegistry.nameService(); } 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 c8126207a73..eda3a092f2b 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 @@ -6,6 +6,7 @@ import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.zone.RoutingMethod; import com.yahoo.config.provision.zone.ZoneId; +import com.yahoo.vespa.flags.PermanentFlags; import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationVersion; import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType; import com.yahoo.vespa.hosted.controller.api.integration.deployment.RunId; @@ -2021,4 +2022,24 @@ public class DeploymentTriggerTest { List<RetriggerEntry> retriggerEntries = tester.controller().curator().readRetriggerEntries(); Assert.assertEquals(1, retriggerEntries.size()); } + + @Test + public void testOrchestrationWithIncompatibleVersionPairs() { + Version version1 = new Version("7"); + Version version2 = new Version("8"); + tester.controllerTester().flagSource().withListFlag(PermanentFlags.INCOMPATIBLE_VERSIONS.id(), List.of("8"), String.class); + + tester.controllerTester().upgradeSystem(version1); + DeploymentContext app = tester.newDeploymentContext() + .submit(new ApplicationPackageBuilder().region("us-east-3") + .compileVersion(version1) + .build()) + .deploy(); + + app.submit(new ApplicationPackageBuilder().region("us-east-3") + .compileVersion(version2) + .build()); + app.deploy(); + } + } |