diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-02-20 14:42:04 +0100 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-02-20 14:42:04 +0100 |
commit | dd7c68f81ef0eb44b6d62cb7dea2e25687bbc8a6 (patch) | |
tree | b64a0407868c96d4a32adf5602719fa02d01caf6 /controller-server | |
parent | 85e394563c8b711a1a0307c8ac5953c1817f5629 (diff) |
Ignore failure cooldown for manually triggered test jobs
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java index 49788b643e0..b58cac27cdb 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java @@ -34,6 +34,7 @@ import java.util.NoSuchElementException; import java.util.Objects; import java.util.Optional; import java.util.OptionalLong; +import java.util.function.Predicate; import java.util.function.Supplier; import java.util.logging.Logger; import java.util.stream.Stream; @@ -218,7 +219,7 @@ public class DeploymentTrigger { controller.systemVersion()); String reason = "Job triggered manually by " + user; return (jobType.isProduction() && ! isTested(application, versions) - ? testJobs(application, versions, reason, clock.instant()).stream() + ? testJobs(application, versions, reason, clock.instant(), __ -> true).stream() : Stream.of(deploymentJob(application, versions, application.change(), jobType, reason, clock.instant()))) .peek(this::trigger) .map(Job::jobType).collect(toList()); @@ -540,11 +541,18 @@ public class DeploymentTrigger { * Returns the list of test jobs that should run now, and that need to succeed on the given versions for it to be considered tested. */ private List<Job> testJobs(Application application, Versions versions, String reason, Instant availableSince) { + return testJobs(application, versions, reason, availableSince, jobType -> canTrigger(jobType, versions, application)); + } + + /** + * Returns the list of test jobs that need to succeed on the given versions for it to be considered tested, filtered by the given condition. + */ + private List<Job> testJobs(Application application, Versions versions, String reason, Instant availableSince, Predicate<JobType> condition) { List<Job> jobs = new ArrayList<>(); for (JobType jobType : steps(application.deploymentSpec()).testJobs()) { Optional<JobRun> completion = successOn(application, jobType, versions) .filter(run -> versions.sourcesMatchIfPresent(run) || jobType == systemTest); - if ( ! completion.isPresent() && canTrigger(jobType, versions, application)) + if ( ! completion.isPresent() && condition.test(jobType)) jobs.add(deploymentJob(application, versions, application.change(), jobType, reason, availableSince)); } return jobs; |