Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.scheduler.tests.test_api_client.TestScheduler::test_origin_visit_stats_upsert
Failed

TEST RESULT

Run At
Jan 20 2021, 12:53 PM
Details
data = b'\x81\x92\xb7https://github.com/test\xa3git\x82\xc4\x07swhtype\xafscheduler_model\xc4\x01d\x89\xa3url\xb7https://gith...xc0\xablast_failed\xc0\xadlast_notfound\xc0\xaelast_scheduled\xc0\xadlast_snapshot\xc0\xa8__type__\xb0OriginVisitStats' extra_decoders = {'scheduler_model': <function <lambda> at 0x7fd10657b1e0>} def msgpack_loads(data: bytes, extra_decoders=None) -> Any: """Read data as a msgpack stream. .. Caution:: This function is used by swh.journal to decode the contents of the journal. This function **must** be kept backwards-compatible. """ decoders = get_decoders(extra_decoders) def ext_hook(code, data): if code == MsgpackExtTypeCodes.LONG_INT.value: return int.from_bytes(data, "big") elif code == MsgpackExtTypeCodes.LONG_NEG_INT.value: return -int.from_bytes(data, "big") raise ValueError("Unknown msgpack extended code %s" % code) def decode_types(obj): # Support for current encodings if set(obj.keys()) == {b"d", b"swhtype"}: decoder = decoders.get(obj[b"swhtype"]) if decoder: return decoder(obj[b"d"]) # Fallthrough return obj try: try: return msgpack.unpackb( data, raw=False, object_hook=decode_types, ext_hook=ext_hook, > strict_map_key=False, ) .tox/py3/lib/python3.7/site-packages/swh/core/api/serializers.py:292: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E TypeError: unhashable type: 'list' msgpack/_unpacker.pyx:195: TypeError During handling of the above exception, another exception occurred: self = <swh.scheduler.tests.test_scheduler.TestScheduler object at 0x7fd10416a3c8> swh_scheduler = <RemoteScheduler url=mock://example.com/> def test_origin_visit_stats_upsert(self, swh_scheduler) -> None: eventful_date = utcnow() url = "https://github.com/test" visit_stats = OriginVisitStats( url=url, visit_type="git", last_eventful=eventful_date, last_uneventful=None, last_failed=None, last_notfound=None, ) swh_scheduler.origin_visit_stats_upsert([visit_stats]) swh_scheduler.origin_visit_stats_upsert([visit_stats]) > assert swh_scheduler.origin_visit_stats_get([(url, "git")]) == { (url, "git"): visit_stats } .tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_scheduler.py:794: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:181: in meth_ return self.post(meth._endpoint_path, post_data) .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:278: in post return self._decode_response(response) .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:355: in _decode_response return decode_response(response, extra_decoders=self.extra_type_decoders) .tox/py3/lib/python3.7/site-packages/swh/core/api/serializers.py:120: in decode_response r = msgpack_loads(response.content, extra_decoders=extra_decoders) .tox/py3/lib/python3.7/site-packages/swh/core/api/serializers.py:296: in msgpack_loads data, raw=False, object_hook=decode_types, ext_hook=ext_hook _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: list is not allowed for map key msgpack/_unpacker.pyx:195: ValueError