Actually, I mistyped. The former should be

stage('Test') {
  steps {
    timeout (time: 1, unit: 'HOURS') {
      sh './test.sh'
    }
  }
}

That is, the position of steps and timeout are swapped. Does this have a 
practical difference?

Thanks,
—Sagar

On Wednesday, August 18, 2021 at 7:27:11 PM UTC-4 Sagar Patel wrote:

> I'm observing that the former can incorrectly indicate that the stage 
> passed when in fact it was aborted/terminated due to timeout. The latter 
> doesn't have this bug.
>
> Has anyone seen this before?
>
> —Sagar
>
> On Wednesday, August 18, 2021 at 9:13:53 AM UTC-4 Sagar Patel wrote:
>
>> Hi,
>>
>> Is there any difference between the timeout section and the timeout 
>> option? For example, are
>>
>> stage('Test') {
>>   timeout (time: 1, unit: 'HOURS') {
>>     steps {
>>       ./test.sh
>>     }
>>   }
>> }
>>
>> and
>>
>> stage('Test') {
>>   option { timeout (time: 1, unit: 'HOURS') }
>>   steps {
>>     ./test.sh
>>   }
>> }
>>
>> equivalent?
>>
>> Jenkins version: 2.289.3
>>
>> Thanks,
>> —Sagar
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5ab91365-0ecb-4b40-ab3e-bb202fd3d43cn%40googlegroups.com.

Reply via email to