Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: disk size is ok if less than 4 percent of expected #420

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

richm
Copy link
Contributor

@richm richm commented Jan 30, 2024

QE reported a test failure like this:

TASK [Show actual size] ********************************************************
ok: [localhost] => {
    "storage_test_actual_size": {
        "bytes": 1649267441664,
        "changed": false,
        "failed": false,
        "lvm": "1t",
        "parted": "1TiB",
        "size": "1 TiB"
    }
}

TASK [Show expected size] ******************************************************
ok: [localhost] => {
    "storage_test_expected_size": "1600321314816"
}

TASK [Assert expected size is actual size] *************************************
fatal: [localhost]: FAILED! => {
    "assertion": "(storage_test_expected_size | int - storage_test_actual_size.bytes) | abs / storage_test_expected_size | int < 0.02",
    "changed": false,
    "evaluated_to": false,
    "msg": "Volume test1 has unexpected size (expected: 1600321314816 / actual: 1649267441664)"
}

PLAY RECAP *********************************************************************

In this case,

>>> abs(1600321314816-1649267441664)/1600321314816
0.03058518710889486

I think this is correct, so raising the percentage to check to 4.

Signed-off-by: Rich Megginson rmeggins@redhat.com

QE reported a test failure like this:
```
TASK [Show actual size] ********************************************************
ok: [localhost] => {
    "storage_test_actual_size": {
        "bytes": 1649267441664,
        "changed": false,
        "failed": false,
        "lvm": "1t",
        "parted": "1TiB",
        "size": "1 TiB"
    }
}

TASK [Show expected size] ******************************************************
ok: [localhost] => {
    "storage_test_expected_size": "1600321314816"
}

TASK [Assert expected size is actual size] *************************************
fatal: [localhost]: FAILED! => {
    "assertion": "(storage_test_expected_size | int - storage_test_actual_size.bytes) | abs / storage_test_expected_size | int < 0.02",
    "changed": false,
    "evaluated_to": false,
    "msg": "Volume test1 has unexpected size (expected: 1600321314816 / actual: 1649267441664)"
}

PLAY RECAP *********************************************************************
```

In this case,
```
>>> abs(1600321314816-1649267441664)/1600321314816
0.03058518710889486
```
I think this is correct, so raising the percentage to check to 4.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm
Copy link
Contributor Author

richm commented Jan 30, 2024

@vojtechtrefny @japokorn @yizhanglinux this is the second time we have had to increase the percentage here. I think it is still correct, and hoping that there is a better way to determine if the actual size is the expected size.

@richm richm merged commit c190a87 into linux-system-roles:main Jan 31, 2024
12 of 17 checks passed
@richm richm deleted the actual-size-4-percent branch January 31, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant