Project

General

Profile

action #105984

Updated by okurz almost 3 years ago

## Observation 
 See https://github.com/os-autoinst/os-autoinst/pull/1947#issuecomment-1030202917 

 https://app.codecov.io/gh/os-autoinst/os-autoinst/compare/1947/changes 
 The changes being marked for lost coverage are: 
 ``` 
 # backend/baseclass.pm 
 346          while ($select->count) { 
 347              $! = 0; 
 348              die($! ? "$!\n" : 'timeout exceeded') unless my @ready = $select->can_write($timeout); 
 349              for my $fh (@ready) { 
 350                  if (defined $internal_pipe && $fh == $internal_pipe) { 
 351                      $self->_write_buffered_data_to_file_handle('Encoder', $video_data_for_internal_encoder, $fh); 
 352                      $select->remove($fh) unless @$video_data_for_internal_encoder; 
 ``` 

 ## Acceptance criteria 
 * **AC1:** Reliable coverage reports in codecov for backend/baseclass.pm 

 ## Suggestions 
 * Try to reach the according code path from unit tests because the problem is likely caused by tests which trigger the above code indirectly and depending on timing behaviour hit the code or not sometimes 
 * IO::Select is already mocked in t/23-baseclass.t so likely the same approach can be used here 
 * If it's hard to reach the code consider extracting methods that can be covered separately

Back