Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.scheduler.tests.test_journal_client::test_journal_client_origin_visit_status_from_journal_last_notfound
Failed

TEST RESULT

Run At
Jan 15 2021, 8:54 AM
Details
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7fd5f784fe48> def test_journal_client_origin_visit_status_from_journal_last_notfound(swh_scheduler): visit_status = { "origin": "foo", "visit": 1, "status": "not_found", "date": D1, "type": "git", "snapshot": None, } process_journal_objects( {"origin_visit_status": [visit_status]}, scheduler=swh_scheduler ) actual_origin_visit_stats = swh_scheduler.origin_visit_stats_get( visit_status["origin"], visit_status["type"] ) assert actual_origin_visit_stats == OriginVisitStats( url=visit_status["origin"], visit_type=visit_status["type"], last_eventful=None, last_uneventful=None, last_failed=None, last_notfound=visit_status["date"], last_snapshot=None, ) visit_statuses = [ { "origin": "foo", "visit": 4, "status": "not_found", "date": D3, "type": "git", "snapshot": None, }, { "origin": "foo", "visit": 3, "status": "not_found", "date": D2, "type": "git", "snapshot": None, }, ] process_journal_objects( > {"origin_visit_status": visit_statuses}, scheduler=swh_scheduler ) .tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_journal_client.py:130: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/scheduler/journal_client.py:89: in process_journal_objects scheduler.origin_visit_stats_upsert(origin_visit_stats) .tox/py3/lib/python3.7/site-packages/swh/core/db/common.py:62: in _meth return meth(self, *args, db=db, cur=cur, **kwargs) .tox/py3/lib/python3.7/site-packages/swh/scheduler/backend.py:813: in origin_visit_stats_upsert fetch=False, .tox/py3/lib/python3.7/site-packages/psycopg2/extras.py:1292: in execute_values cur.execute(b''.join(parts)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cursor object at 0x7fd5ff29bc48; closed: -1> query = b"\n INSERT into origin_visit_stats AS ovi (last_eventful, last_failed, last_notfound, last_snapshot, last_...\n else ovi.last_snapshot -- touch nothing\n end\n )\n " vars = None def execute(self, query, vars=None): self.column_mapping = [] self._query_executed = True > return super(RealDictCursor, self).execute(query, vars) E psycopg2.errors.CardinalityViolation: ON CONFLICT DO UPDATE command cannot affect row a second time E HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values. .tox/py3/lib/python3.7/site-packages/psycopg2/extras.py:251: CardinalityViolation