Iostat refactor

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-11 18:12:54 +01:00
parent 70defbdf0d
commit 940990e37a
3 changed files with 21 additions and 17 deletions

View File

@@ -372,4 +372,4 @@ def test_clean_remove_core_without_fs(cache_mode):
def check_device_write_stats(device: Device):
return IOstatBasic.get_iostat_list(devices_list=[device])[0].total_writes.value
return IOstatBasic.get_iostat_list(devices_list=[device.get_device_id()])[0].total_writes.value

View File

@@ -89,10 +89,14 @@ def test_wb_throttling():
with TestRun.step("Wait for IO processes to finish and print debug informations"):
sleep_interval = timedelta(seconds=5)
eta = runtime
while eta.total_seconds() > 0:
while int(eta.total_seconds()) > 0:
# Instead of explicit sleeping with `time.sleep()` iostat is used for waiting
iostat = IOstatExtended.get_iostat_list(
[core, cache_device, core_device],
[
core.get_device_id(),
cache_device.get_device_id(),
core_device.get_device_id()
],
since_boot=False,
interval=int(sleep_interval.total_seconds()),
)