Project

General

Profile

action #124961

Updated by mkittler about 1 year ago

## Observation 

 When cancelling a job with `RETRY=1` (or any number larger than 0), openQA automatically restarts the job. This is expected for any failed state, but not for cancellation 

 ## Acceptance criteria 
 * *AC1**: Jobs cancelled by users are not restarted automatically (even when `RETRY` is used). What happens to other cancelled jobs may still remain undefined/suboptimal. 

 ## Out of scope 
 - Fixing the mess you can see in #110458 

 ## Steps to reproduce 

 * Create job with `RETRY=1` 
 * Cancel the job 

 ## Impact / problem 

 When cancelling jobs with `RETRY`, we need to cancel N jobs. 

 ## Notes Problem 

 When cancelling jobs with `RETRY`, we need to cancel N jobs. 

 ## Suggestion 
 * https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Schema/Result/Jobs.pm#L1999 Jobs that are cancelled will job be retried. 

 ## Workaround 
 ``` 
     $self->auto_duplicate if $restart || (!$self->is_ok && $self->handle_retry); 
 ``` 
 * https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Schema/Result/Jobs.pm#L560 
 ``` 
 sub is_ok ($self) { 
     return 0 unless my $result = $self->result; 
     return 1 if grep { $_ eq $result } OK_RESULTS; 
     return 0; 
 } 
 ``` 
 * https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Jobs/Constants.pm#L76 
 ``` 
 use constant OK_RESULTS => (PASSED, SOFTFAILED); 
 ``` None identified

Back