Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ def wait_for(fn: Callable[[], object], msg: str | None = None, timeout_secs: int
return
if time.perf_counter() - start_time >= timeout_secs:
expected = 'True' if not invert else 'False'
suffix = ": " + msg if msg else ""
raise TimeoutError(
"Timeout reached while waiting for fn call to yield %s (%s)." % (expected, timeout_secs)
"Timed out after %ss waiting for condition to be %s%s" % (timeout_secs, expected, suffix)
Comment on lines -209 to +210

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example output would help

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously, it looked like:

FAILED tests/unit/test_rescan_block_devices_info.py::test_timeout - TimeoutError: Timeout reached while waiting for fn call to yield True (10).

with this change:

FAILED tests/unit/test_rescan_block_devices_info.py::test_timeout - TimeoutError: Timed out after 10s waiting for condition to be True: Wait for coalesce.

)
time.sleep(retry_delay_secs)

Expand Down