When a job detected by polling fails, it will run again the next time polling runs even when there are no new changes since last poll. For example.
(1) Build works.
(2) No new changes = Next poll no execution.
(3) New change made = Next poll execution.
(4) Build fails = Next poll execution.
(5) Build fails = Next poll execution.
(6) Build works = Next poll no execution.
Reproductions steps:
(1) Create a pipeline job with the following Jenkinsfile and set it up to poll every minutes (or use the PollNow plugin):
pipeline { agent { label 'master' } stages { stage("Run script") { steps { script { def failJob = input(message: 'Do you wish this job to work?', ok: 'OK', parameters: [booleanParam(defaultValue: true, description: 'If you want this to fail untick yes and click YES', name: 'Yes?')]) echo "Input Result:" + failJob if (failJob == false) { sh 'Arghhhhh' } echo "P4_CLIENT is:" echo env.P4_CLIENT } } } } }
(2) Submit a changelist to the polled view.
(3) Wait for job to run, go into the console for the job execution and click on 'Input requested', Untick 'Yes?' then click 'OK'. Job will be marked as 'FAILURE'.
(4) Wait for next poll or click 'Poll Now'. Job will trigger again.
(5) On 'Input requested just click 'OK'. Job will be marked as 'SUCCESS'.
(6) Wait for next poll or click 'Poll Now'. Job will NOT trigger again.
- is duplicated by
-
JENKINS-54076 Polling keeps building without changes on error
- Closed
- is related to
-
JENKINS-56295 multibranch jobs triggering repeatedly
- Closed