diff --git a/tests/client-dbus/tests/udev/_utils.py b/tests/client-dbus/tests/udev/_utils.py index 289a0595fd..fed1114d59 100644 --- a/tests/client-dbus/tests/udev/_utils.py +++ b/tests/client-dbus/tests/udev/_utils.py @@ -449,12 +449,13 @@ def wait_for_pools(self, expected_num, *, name=None): :return: list of pool information found :rtype: list of (str * MOPool) """ - (count, limit, dbus_err, found_num, known_pools) = ( + (count, limit, dbus_err, found_num, known_pools, start_time) = ( 0, expected_num + 1, None, None, None, + time.time(), ) while count < limit and not expected_num == found_num: try: @@ -469,7 +470,10 @@ def wait_for_pools(self, expected_num, *, name=None): count += 1 if found_num is None and dbus_err is not None: - raise dbus_err + raise RuntimeError( + f"After {time.time() - start_time:.2f} seconds, the only " + "response is a D-Bus exception" + ) from dbus_err self.assertEqual(found_num, expected_num) diff --git a/tests/client-dbus/tests/udev/test_udev.py b/tests/client-dbus/tests/udev/test_udev.py index dcfd02cce2..0bb3685041 100644 --- a/tests/client-dbus/tests/udev/test_udev.py +++ b/tests/client-dbus/tests/udev/test_udev.py @@ -254,11 +254,9 @@ def _simple_initial_discovery_test( (_, (pool_object_path, device_object_paths)) = create_pool( random_string(5), devnodes, key_description=key_description ) - pool_uuid = Pool.Properties.Uuid.Get(get_object(pool_object_path)) - - self.wait_for_pools(1) - wait_for_udev(STRATIS_FS_TYPE, get_devnodes(device_object_paths)) + self.wait_for_pools(1) + pool_uuid = Pool.Properties.Uuid.Get(get_object(pool_object_path)) if take_down_dm: remove_stratis_dm_devices() @@ -345,9 +343,8 @@ def _simple_event_test(self, *, key_spec=None): # pylint: disable=too-many-loca (_, (pool_object_path, _)) = create_pool( random_string(5), devnodes, key_description=key_description ) - pool_uuid = Pool.Properties.Uuid.Get(get_object(pool_object_path)) - self.wait_for_pools(1) + pool_uuid = Pool.Properties.Uuid.Get(get_object(pool_object_path)) remove_stratis_dm_devices()