From 98ac178cc7fc1cf886f38dae7ae5367780629686 Mon Sep 17 00:00:00 2001 From: Anton Myagkov Date: Fri, 27 Sep 2024 11:29:07 +0200 Subject: [PATCH] fix: acceptance test failure (#2148) 1. disable disk auto-detach to debug test after failure 2. use wait_for_block_device_to_appear implementation from helpers --- .../test/acceptance/test_runner/lib/helpers.py | 7 ++++--- .../test/acceptance/test_runner/lib/instance_policy.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cloud/disk_manager/test/acceptance/test_runner/lib/helpers.py b/cloud/disk_manager/test/acceptance/test_runner/lib/helpers.py index 275717baf1e..4de8c40303c 100644 --- a/cloud/disk_manager/test/acceptance/test_runner/lib/helpers.py +++ b/cloud/disk_manager/test/acceptance/test_runner/lib/helpers.py @@ -37,9 +37,10 @@ def wait_for_block_device_to_appear( disk_id: str, module_factory, ssh_key_path: str | None = None, -) -> str: - device_to_id_mapper = VirtualDevicesToIdMapper(ip, module_factory, ssh_key_path) - return device_to_id_mapper.wait_for_disk_to_appear(disk_id) +): + device_name = f'/dev/disk/by-id/virtio-{disk_id}' + helpers = module_factory.make_helpers(False) + helpers.wait_for_block_device_to_appear(ip, device_name, ssh_key_path=ssh_key_path) class VirtualDevicesToIdMapper: diff --git a/cloud/disk_manager/test/acceptance/test_runner/lib/instance_policy.py b/cloud/disk_manager/test/acceptance/test_runner/lib/instance_policy.py index eda821219b7..034a977f38b 100644 --- a/cloud/disk_manager/test/acceptance/test_runner/lib/instance_policy.py +++ b/cloud/disk_manager/test/acceptance/test_runner/lib/instance_policy.py @@ -75,7 +75,8 @@ def obtain(self) -> Ycp.Instance: @contextmanager def attach_disk(self, disk: Ycp.Disk): - with self._ycp.attach_disk(self._instance, disk): + # Temprorary disable autodetach to debug acceptance test failure + with self._ycp.attach_disk(self._instance, disk, None, False): yield wait_for_block_device_to_appear( self._instance.ip, disk.id,