Project

General

Profile

Actions

action #105984

closed

[os-autoinst][flaky] flaky coverage in backend/baseclass.pm size:M

Added by okurz about 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2022-02-05
Due date:
2022-03-03
% Done:

0%

Estimated time:

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
Actions #1

Updated by tinita about 2 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.

Actions #3

Updated by okurz about 2 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
Actions #4

Updated by tinita about 2 years ago

  • Status changed from Workable to In Progress
  • Assignee set to tinita
Actions #5

Updated by openqa_review about 2 years ago

  • Due date set to 2022-03-03

Setting due date based on mean cycle time of SUSE QE Tools

Actions #6

Updated by tinita about 2 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.

Actions #8

Updated by tinita about 2 years ago

  • Status changed from In Progress to Feedback
Actions #9

Updated by tinita about 2 years ago

  • Status changed from Feedback to Resolved

PR was merged

Actions

Also available in: Atom PDF