Skip to content

Commit

Permalink
Wait for D-Bus to settle in metadata tests
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jul 15, 2024
1 parent 5006c05 commit 5fb6ec8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ class PoolMetadataMonitor(unittest.TestCase):
Manage verification of consistency of pool-level metadata.
"""

def run_check(self):
def _check_thin_meta_allocations(self, metadata):
"""
Check whether sizes of thin meta and thin meta spare match.
Expand All @@ -241,10 +240,17 @@ def _check_thin_meta_allocations(self, metadata):
"total size of thin meta spare device.",
)

def run_check(self, stop_time):
"""
Run the check.
:param int stop_time: the time the test completed
"""
if PoolMetadataMonitor.verify: # pylint: disable=no-member

# Wait for D-Bus to settle, so D-Bus and metadata can be compared
time.sleep(sleep_time(stop_time, 16))

for object_path, _ in StratisDbus.pool_list():
(current, current_return_code, current_message) = (
StratisDbus.pool_get_metadata(object_path)
Expand Down Expand Up @@ -589,7 +595,7 @@ def tearDown(self):

FilesystemSymlinkMonitor.run_check(self, stop_time)

PoolMetadataMonitor.run_check(self)
PoolMetadataMonitor.run_check(self, stop_time)

@staticmethod
def set_from_post_test_check_option(post_test_check):
Expand Down

0 comments on commit 5fb6ec8

Please sign in to comment.