Eddie M commented on Bug JENKINS-16758

Here is an update on this issue. The issue ultimately is that the result gets set correctly but the build does not stop. To get around this issue I first had to override the setUpEnvironment method. Here I was able to check to see if the result was a failure and if so throw an IOException(Not InterruptException because it will set the result to aborted and I specifically want failure). Dirty but it is an improvement on what I originally had to force kill the build. So with that said I also changed my logic in the onStarted method to only set the result and use setUpEnvironment to only stop the build.

@Override
public Environment setUpEnvironment(AbstractBuild build, Launcher launcher,
BuildListener listener) throws IOException, InterruptedException {
if (build.getResult() != null && build.getResult().isWorseOrEqualTo(Result.FAILURE)) { build.getExecutor().interrupt(Result.FAILURE); throw new IOException("Build failed"); }

return super.setUpEnvironment(build, launcher, listener);
}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to