Skip to content
Permalink
Browse files

[FIXED JENKINS-18931] Build is triggered incorrectly when a triggered…

… build starts running.

Context should be calculated against a completed build not an in progress one.
  • Loading branch information
James Nord
James Nord committed Jul 25, 2013
1 parent 12f65d7 commit 6aac32a245eae1c2800d88a17033ff70c2df2b7a
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java
@@ -101,7 +101,7 @@ protected BuildResultTriggerContext getContext(Node node, XTriggerLog log) throw
for (String jobName : info.getJobNamesAsArray()) {
AbstractProject job = Hudson.getInstance().getItemByFullName(jobName, AbstractProject.class);
if (isValidBuildResultProject(job)) {
Run lastBuild = job.getLastBuild();
Run lastBuild = job.getLastCompletedBuild();
if (lastBuild != null) {
int buildNumber = lastBuild.getNumber();
if (buildNumber != 0) {
@@ -200,7 +200,7 @@ private boolean isMatchingExpectedResults(String jobName, CheckedResult[] expect
}

AbstractProject jobObj = Hudson.getInstance().getItemByFullName(jobName, AbstractProject.class);
Run jobObjLastBuild = jobObj.getLastBuild();
Run jobObjLastBuild = jobObj.getLastCompletedBuild()();
Result jobObjectLastResult = jobObjLastBuild.getResult();

for (CheckedResult checkedResult : expectedResults) {

0 comments on commit 6aac32a

Please sign in to comment.
You can’t perform that action at this time.