Project

General

Profile

Actions

action #117211

closed

coordination #121876: [epic] Handle openQA review failures in Yam squad - SLE 15 SP5

Add sync after dd in snapper_cleanup_timeline

Added by rainerkoenig almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
Start date:
2022-09-26
Due date:
% Done:

0%

Estimated time:

Description

Motivation

The snapper_cleanup_timeline test fails with the message that the free disk space is more than 20%.

The root cause of this problem, is that the test module first performs a dd command and immediately after that it does a df -h to determine the used disk space. The problem is, that dd is using kernel buffers that will then transfered to disk after dd is finished. If df -h is performed immediately after dd then we are still in the phase of transfering buffers to the disk and therefore we get a lower disk usage.

The solution for this is calling sync after the dd command which ensures that all bufffers are indeed written to disk. I made a PoC that looks like this:

    assert_script_run("dd if=/dev/urandom of=/tmp/blob bs=10M count=$block_number", timeout => 1500,
        fail_message => "Failed to fill up disk space");
    assert_script_run("sync", timeout => 60, fail_message => "Failed to sync");
    $used_disk = convert2numeric(get_used_partition_space("/"));

To fix this the Units that are returned from df -h in the filesystem_utils package need to be evaluated as well, otherwise we compare Megabytes with Gigabytes which is obviously wrong. However you do this, keep an eye on where the values are used, because this might affect the $block_number variable used in the dd command.

Acceptance criteria

AC1: The sync is implemented after the dd command and the correct amount of used space is reported.

Additional information

status=progress option might help because it doesn't return until finished, instead of sync command.


Related issues 1 (1 open0 closed)

Related to qe-yam - action #117511: Take into account units when using library filesystem_utils in snapper_cleanup_timelineNew2022-10-04

Actions
Actions

Also available in: Atom PDF