openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

jenkins-plugin: properly handle cancelled jobs #106

Closed gabemontero closed 7 years ago

gabemontero commented 7 years ago

Bug 1357752 Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1357752 Detailed explanation The pipeline plugin needed to throw InterruptedExceptions instead of swallowing them in order to properly handle cancelled jobs

gabemontero commented 7 years ago

Also note - I've updated the PR tester job with @jupierce 's new PR testing changes ... so vetting that piece with this PR as well.

gabemontero commented 7 years ago

Note - manual testing based on bugzilla scenario looks good, including the cancel of the app build per suggestion from @bparees

Jenkins job output:

Starting the "Trigger OpenShift Build" step with build config "nodejs-mongodb-example" from the project "myproject".
  Started build "nodejs-mongodb-example-1" and waiting for build completion ...
Operation will timeout after 900000 milliseconds
Aborted by anonymous

Starting the "Cancel OpenShift Builds" step with build config "nodejs-mongodb-example" from the project "myproject".
Aborted by anonymous
  Cancelled build "nodejs-mongodb-example-1".

Exiting "Cancel OpenShift Builds" successfully with 1 builds cancelled.
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Aborted by anonymous
Aborted by anonymous

Output from oc get builds:

gmontero ~/go/src/github.com/openshift/origin  (master)$ oc get builds
NAME                       TYPE              FROM          STATUS      STARTED              DURATION
nodejs-mongodb-example-1   Source            Git           Cancelled   20 seconds ago       6s
sample-pipeline-1          JenkinsPipeline                 Cancelled   About a minute ago   51s

Regression testing of the freestyle sample job also passed.

Lastly, the update to the PR test job looks good. We are calling @jupierce 's new script and passing the new env var to the extended test invocation and things got invoked correctly. Some of the known issues with the extended test are still out there waiting to get their fixes merged (https://github.com/openshift/origin/pull/11711)

Unless we have more real fixes required, I'll do a test PR to verify everything is in order once all the origin side dependencies have merged.

Will push updates momentarily, allow some time for review before merging and cutting next level for QE to verify.

gabemontero commented 7 years ago

additional cancels pushed

bparees commented 7 years ago

lgtm