I could debug the issues as below.
Scenario:
job-A is an upstream project of job-B. job-B uses build result plugin to monitor job-A and if a new build is found for job-A for the set cron value, job-B should get triggered.
Jenkins ver: 2.71, BuildResultTrigger Plug-in ver: 0.17
Findings:
After Saving the configuration of job-B(by clicking on Apply/Save button), build result plugin will not trigger job-B on a very first time when it finds a new build for job-A on set cron value. But, it works as expected from second time onwards.
Steps to reproduce:
1. For example, current time is 2:15 am
2. job-B BuildResultTrigger settings:
Job to monitor: job-A
Job Build result: SUCCESS
Schedule: H/5 2-5 * * *
This means- every day between 2 to 5 am, it should check on interval of 5 minutes
3. Trigger job-A, it should complete within a minute with SUCCESS
4. At 2:35 am, check BuildResultTriggerLog for job-B
This is the first time when job-A’s new build should have been monitored by build result plugin and should trigger job-B
But it will not work and will show logs like this,
Polling started on Mmm dd, YYYY 2:35:00 AM
Polling for the job job-B
Recording context. Check changes in next poll.
Polling complete. Took 0 ms.
No changes
5. At 2:40 am, check BuildResultTriggerLog for job-B
As there was no new build triggered for job-A, it will show something like this,
Polling started on Mmm dd, YYYY 2:40:00 AM
Polling for the job job-B
Checking changes for job-A.
There are no new builds for the job job-A.
Polling complete. Took 0 ms.
No changes.
6. Trigger job-A second time, it should complete within a minute with SUCCESS. Make sure between step 2 and 6 you have not changed the project configurations for job-B
7. At 2:45 am, check BuildResultTriggerLog for job-B
This is the second time when job-A’s new build should have been monitored by build result plugin and should trigger job-B
This time it will work and will show something like this,
Polling started on Mmm dd, YYYY 2:45:00 AM
Polling for the job job-B
Checking changes for job job-A.
Checking expected job build results for the job job-A.
Checking SUCCESS
Last build result for the job job-A matches the expected result SUCCESS.
Job job-A is modified. Triggering a new build.
Polling complete. Took 0 ms.
Changes found. Scheduling a build.
8. Now onwards, build result plugin will work as expected until you update the project configuration for job-B
The simular situation polling schedule "* * * * *" works fine, but something like "0 9 * * *" with minutes and/or hours skips all checks:
Polling started on Apr 28, 2015 5:50:58 PM
Polling for the job Test_BuildResultTrigger
Recording context. Check changes in next poll.
Polling complete. Took 0 ms.
No changes.
instead
Polling started on Apr 28, 2015 5:56:58 PM
Polling for the job Test_BuildResultTrigger
Checking changes for job Test_BuildResultTrigger_1.
There are no new builds for the job Test_BuildResultTrigger_1.
Checking changes for job Test_BuildResultTrigger_2.
There are no new builds for the job Test_BuildResultTrigger_2.
Checking changes for job Test_BuildResultTrigger_3.
There are no new builds for the job Test_BuildResultTrigger_3.
Polling complete. Took 1 ms.
No changes.