action #105984
closed[os-autoinst][flaky] flaky coverage in backend/baseclass.pm size:M
Description
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
Updated by tinita almost 3 years ago
- Description updated (diff)
I added the lines that codecov complained about.
When creating such a ticket, always add the important lines of the report, because the codecov report gets overwritten by further changes to the PR.
Updated by okurz almost 3 years ago
Updated by okurz almost 3 years ago
- Subject changed from [os-autoinst][flaky] flaky coverage in backend/baseclass.pm to [os-autoinst][flaky] flaky coverage in backend/baseclass.pm size:M
- Description updated (diff)
- Status changed from New to Workable
Updated by tinita almost 3 years ago
- Status changed from Workable to In Progress
- Assignee set to tinita
Updated by openqa_review almost 3 years ago
- Due date set to 2022-03-03
Setting due date based on mean cycle time of SUSE QE Tools
Updated by tinita almost 3 years ago
I wasn't able to get coverage for those lines when running coverage locally.
I'm now trying to cover this with a unit tests, but it's a bit complicated because it involves a number of pipes and several video data I have to manually add to the object, because I don't know how to create an object with this state in a different way.
Updated by tinita almost 3 years ago
Updated by tinita almost 3 years ago
- Status changed from In Progress to Feedback