Merge pull request #1056 from karolinavelkaja/ioclass_id_as_condition_test_fix

fix for test_ioclass_id_as_condition - adding 1s delay before io
This commit is contained in:
Karolina Rogowska 2022-02-18 11:27:09 +01:00 committed by GitHub
commit 583af2e229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
# #
import random import random
import time
from itertools import permutations from itertools import permutations
import pytest import pytest
@ -444,6 +445,8 @@ def test_ioclass_id_as_condition(filesystem):
ioclass_config_path=ioclass_config_path, ioclass_config_path=ioclass_config_path,
) )
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path) casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
# CAS needs some time to resolve directory to inode
time.sleep(ioclass_config.MAX_CLASSIFICATION_DELAY.seconds)
with TestRun.step(f"Prepare {filesystem.name} filesystem " with TestRun.step(f"Prepare {filesystem.name} filesystem "
f"and mount {core.path} at {mountpoint}."): f"and mount {core.path} at {mountpoint}."):
@ -451,6 +454,8 @@ def test_ioclass_id_as_condition(filesystem):
core.mount(mountpoint) core.mount(mountpoint)
fs_utils.create_directory(base_dir_path) fs_utils.create_directory(base_dir_path)
sync() sync()
# CAS needs some time to resolve directory to inode
time.sleep(ioclass_config.MAX_CLASSIFICATION_DELAY.seconds)
with TestRun.step("Run IO fulfilling IO class 1 condition (and not IO class 2) and check if " with TestRun.step("Run IO fulfilling IO class 1 condition (and not IO class 2) and check if "
"it is classified properly."): "it is classified properly."):