swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f95f5895358>
stored_lister = Lister(name='github', instance_name='', id=UUID('e715213d-2459-4c64-920e-64c5ab954383'), current_state={}, created=dat... tzinfo=datetime.timezone.utc), updated=datetime.datetime(2021, 7, 8, 8, 32, 37, 767015, tzinfo=datetime.timezone.utc))
def test_journal_client_origin_visit_status_after_grab_next_visits(
swh_scheduler, stored_lister
):
"""Ensure OriginVisitStat entries created in the db as a result of calling
grab_next_visits() do not mess the OriginVisitStats upsert mechanism.
"""
listed_origins = [
ListedOrigin(lister_id=stored_lister.id, url=url, visit_type=visit_type)
for (url, visit_type) in set((v["origin"], v["type"]) for v in VISIT_STATUSES_2)
]
swh_scheduler.record_listed_origins(listed_origins)
before = utcnow()
swh_scheduler.grab_next_visits(
visit_type="git", count=10, policy="oldest_scheduled_first"
)
after = utcnow()
assert swh_scheduler.origin_visit_stats_get([("cavabarder", "hg")]) == []
assert swh_scheduler.origin_visit_stats_get([("cavabarder", "git")])[0] is not None
process_journal_objects(
{"origin_visit_status": VISIT_STATUSES_2}, scheduler=swh_scheduler
)
for url in ("cavabarder", "iciaussi"):
ovs = swh_scheduler.origin_visit_stats_get([(url, "git")])[0]
assert before <= ovs.last_scheduled <= after
> ovs = swh_scheduler.origin_visit_stats_get([(url, "hg")])[0]
E IndexError: list index out of range
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_journal_client.py:667: IndexError
TEST RESULT
TEST RESULT
- Run At
- Jul 8 2021, 10:32 AM