visit_statuses = ({'date': datetime.datetime(2021, 6, 29, 10, 36, 3, 962269, tzinfo=datetime.timezone.utc), 'origin': 'cavabarder', 'sn...cavabarder', 'snapshot': b'\xaa\xaa\xaa\xbb\xbe\xb6\xcf\x9e\xfd[\x92\n\x84S\xe1\xe0qW\xb6\xcd', 'status': 'full', ...})
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f4901101128>
@pytest.mark.parametrize(
"visit_statuses",
permutations(VISIT_STATUSES_SAME_SNAPSHOT, len(VISIT_STATUSES_SAME_SNAPSHOT)),
)
def test_journal_client_origin_visit_statuses_same_snapshot_permutation(
visit_statuses, swh_scheduler
):
"""Ensure out of order topic subscription ends up in the same final state
"""
process_journal_objects(
{"origin_visit_status": visit_statuses}, scheduler=swh_scheduler
)
> assert swh_scheduler.origin_visit_stats_get([("cavabarder", "hg")]) == [
OriginVisitStats(
url="cavabarder",
visit_type="hg",
last_eventful=DATE1,
last_uneventful=DATE1 + 2 * ONE_YEAR,
last_failed=None,
last_notfound=None,
last_snapshot=hash_to_bytes("aaaaaabbbeb6cf9efd5b920a8453e1e07157b6cd"),
next_visit_queue_position=None,
next_position_offset=6, # 2 uneventful visits, whatever the permutation
)
]
E AssertionError: assert [OriginVisitS...ion_offset=6)] == [OriginVisitS...ion_offset=6)]
E At index 0 diff: OriginVisitStats(url='cavabarder', visit_type='hg', last_eventful=datetime.datetime(2021, 6, 29, 10, 36, 3, 962269, tzinfo=datetime.timezone.utc), last_uneventful=datetime.datetime(2023, 7, 1, 10, 36, 3, 962269, tzinfo=datetime.timezone.utc), last_failed=None, last_notfound=None, last_scheduled=None, last_snapshot=b'\xaa\xaa\xaa\xbb\xbe\xb6\xcf\x9e\xfd[\x92\n\x84S\xe1\xe0qW\xb6\xcd', next_visit_queue_position=datetime.datetime(2021, 7, 21, 16, 51, 29, 84635, tzinfo=datetime.timezone.utc), next_position_offset=6) != OriginVisitStats(url='cavabarder', vis...
E
E ...Full output truncated (6 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_journal_client.py:758: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 1 2021, 12:37 PM