Skip to content

Commit

Permalink
Merge pull request #45 from basil/master
Browse files Browse the repository at this point in the history
JENKINS-24450 JacocoPublisher serializes concurrent builds waiting for checkpoint
  • Loading branch information
centic9 committed Sep 13, 2014
2 parents b1e2ad7 + a4ac13b commit 68adb76
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/jacoco/JacocoBuildAction.java
Expand Up @@ -250,7 +250,7 @@ public JacocoBuildAction getPreviousResult() {
if(b==null) {
return null;
}
if(b.getResult()== Result.FAILURE || b.getResult() == Result.ABORTED) {
if (b.isBuilding() || b.getResult() == Result.FAILURE || b.getResult() == Result.ABORTED) {
continue;
}
JacocoBuildAction r = b.getAction(JacocoBuildAction.class);
Expand Down
Expand Up @@ -39,7 +39,7 @@ public String getUrlName() {
*/
public JacocoBuildAction getLastResult() {
for (AbstractBuild<?, ?> b = project.getLastBuild(); b != null; b = b.getPreviousBuild()) {
if (b.getResult() == Result.FAILURE || b.getResult() == Result.ABORTED)
if (b.isBuilding() || b.getResult() == Result.FAILURE || b.getResult() == Result.ABORTED)
continue;
JacocoBuildAction r = b.getAction(JacocoBuildAction.class);
if (r != null)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/jacoco/JacocoPublisher.java
Expand Up @@ -404,7 +404,7 @@ public Action getProjectAction(AbstractProject<?, ?> project) {
}

public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.BUILD;
return BuildStepMonitor.NONE;
}

@Override
Expand Down
Expand Up @@ -84,7 +84,7 @@ public static Map<LocalDate, JacocoCoverageResultSummary> loadChartDataWithinRan
// date range (last build date minus number of days)
for (Job job : jobs) {

Run run = job.getLastBuild();
Run run = job.getLastCompletedBuild();

if (null != run) {
LocalDate runDate = new LocalDate(run.getTimestamp());
Expand All @@ -94,6 +94,9 @@ public static Map<LocalDate, JacocoCoverageResultSummary> loadChartDataWithinRan
summarize(summaries, run, runDate, job);

run = run.getPreviousBuild();
while (run != null && run.isBuilding()) {
run = run.getPreviousBuild();
}

if (null == run) {
break;
Expand Down
Expand Up @@ -96,7 +96,7 @@ public static int validateChartAttributes(String attribute, int defaultValue) {
public static LocalDate getLastDate(List<Job> jobs) {
LocalDate lastDate = null;
for (Job<?,?> job : jobs) {
Run<?,?> lastRun = job.getLastBuild();
Run<?,?> lastRun = job.getLastCompletedBuild();
if (lastRun != null) {
LocalDate date = new LocalDate(lastRun.getTimestamp());
if (lastDate == null) {
Expand Down

0 comments on commit 68adb76

Please sign in to comment.