Avoid continuously running tests in delay with more than one target
@@ -292,10 +292,12 @@ public class DeploymentTrigger {
if (completedAt.isPresent())
jobs.add(deploymentJob(application, target, application.change(), job, reason, completedAt.get(), stepJobs));
}
- else if (testJobs == null)
+ else if (testJobs == null) {
+ if ( ! alreadyTriggered(application, target))
testJobs = testJobsFor(application, target, "Testing deployment for " + job.jobName(), completedAt.orElse(clock.instant()));
}
}
+ }
else { // All jobs are complete -- find the time of completion of this step.
if (stepJobs.isEmpty()) { // No jobs means this is delay step.
Duration delay = ((DeploymentSpec.Delay) step).duration();
