Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa/tasks/cephfs/test_misc: switch duration to timeout #54683

Merged
merged 2 commits into from Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions qa/tasks/cephfs/test_misc.py
Expand Up @@ -276,23 +276,23 @@ def _test_sync_stuck_for_around_5s(self, dir_path, file_sync=False):
self.mount_a.run_shell(["mkdir", os.path.join(dir_path, f"{i}_{j}")])
start = time.time()
if file_sync:
self.mount_a.run_shell(['python3', '-c', sync_dir_pyscript])
self.mount_a.run_shell(['python3', '-c', sync_dir_pyscript], timeout=4)
else:
self.mount_a.run_shell(["sync"])
self.mount_a.run_shell(["sync"], timeout=4)
# the real duration should be less than the rough one
duration = time.time() - start
log.info(f"sync mkdir i = {i}, duration = {duration}")
self.assertLess(duration, 4)
neesingh-rh marked this conversation as resolved.
Show resolved Hide resolved
log.info(f"sync mkdir i = {i}, rough duration = {duration}")

for j in range(5):
self.mount_a.run_shell(["rm", "-rf", os.path.join(dir_path, f"{i}_{j}")])
start = time.time()
if file_sync:
self.mount_a.run_shell(['python3', '-c', sync_dir_pyscript])
self.mount_a.run_shell(['python3', '-c', sync_dir_pyscript], timeout=4)
else:
self.mount_a.run_shell(["sync"])
self.mount_a.run_shell(["sync"], timeout=4)
dparmar18 marked this conversation as resolved.
Show resolved Hide resolved
# the real duration should be less than the rough one
duration = time.time() - start
log.info(f"sync rmdir i = {i}, duration = {duration}")
self.assertLess(duration, 4)
log.info(f"sync rmdir i = {i}, rough duration = {duration}")

self.mount_a.run_shell(["rm", "-rf", dir_path])

Expand Down