haf_system_tests seems a bit unstable: failed first time, but passed when I retried it for https://gitlab.syncad.com/hive/haf/-/pipelines/49289
Failing test is here: https://gitlab.syncad.com/hive/haf/-/jobs/330168
Partial excerpt from log of above:
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
cachedir: .tox/py38/.pytest_cache
rootdir: /builds/hive/haf/tests/integration, configfile: pytest.ini
plugins: timeout-2.0.1, repeat-0.9.1
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 9 items
system/haf/test_blocks_reversible.py .
system/haf/test_compare_forked_node_database.py .
system/haf/test_event_after_replay.py F
system/haf/test_event_massive_sync.py .
system/haf/test_event_new_and_irreversible.py .
system/haf/test_live_sync.py F
system/haf/test_operations_after_switching_fork.py .
system/haf/test_undo_operations.py .
system/haf/test_undo_transactions.py .
=================================== FAILURES ===================================
___________________________ test_event_after_replay ____________________________
prepared_networks_and_database = ({'Alpha': <test_tools.__private.user_handles.handles.network_handle.NetworkHandle object at 0x7f51443be8b0>, 'Beta': ... at 0x7f5144372d60>}, <sqlalchemy.orm.session.Session object at 0x7f51443be970>, <class 'sqlalchemy.ext.automap.Base'>)
def test_event_after_replay(prepared_networks_and_database):
tt.logger.info(f'Start test_event_after_replay')
# GIVEN
networks, session, Base = prepared_networks_and_database
node_under_test = networks['Beta'].node('ApiNode0')
events_queue = Base.classes.events_queue
# WHEN
> run_networks(networks, replay_all_nodes=True)
system/haf/test_event_after_replay.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
local_tools/local_tools.py:106: in run_networks
wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
event = <threading.Event object at 0x7f51445f4ca0>
deadline = 1658173874.6064143
exception_message = 'Live mode not activated on time.'
def wait_for_event(event: 'Event',
deadline: Optional[float] = None,
exception_message: str = 'The event didn\'t occur within given time frame') -> None:
"""
Blocks current thread execution until `event` is set. Optionally raises `exception`, when
`deadline` is reached.
:param event: Awaited event. When event is set functions stops blocking.
:param deadline: Time point before which event must occur. Can be counted from the formula:
deadline = now + timeout
:param exception_message: When deadline is reached, TimeoutError with message specified by
this parameter will be raised.
"""
timeout = deadline - time.time()
if not event.wait(timeout):
> raise TimeoutError(exception_message)
E TimeoutError: Live mode not activated on time.
../../hive/tests/test_tools/package/test_tools/__private/wait_for.py:40: TimeoutError