Page MenuHomeSoftware Heritage

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

TEST RESULT

Run At
Jan 20 2021, 12:53 PM
Details
data = b'\x81\x92\xb2interesting-origin\xa3git\x82\xc4\x07swhtype\xafscheduler_model\xc4\x01d\x89\xa3url\xb2interesting-origi...adlast_snapshot\xc4\x14\xd8\x1c\xc0q\x0e\xb6\xcf\x9e\xfd[\x92\n\x84S\xe1\xe0qW\xb6\xcd\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 0x7fd0fff50860> swh_scheduler = <RemoteScheduler url=mock://example.com/> def test_origin_visit_stats_upsert_messing_with_time(self, swh_scheduler) -> None: url = "interesting-origin" # Let's play with dates... date2 = utcnow() date1 = date2 - ONEDAY date0 = date1 - ONEDAY assert date0 < date1 < date2 snapshot2 = hash_to_bytes("d81cc0710eb6cf9efd5b920a8453e1e07157b6cd") snapshot0 = hash_to_bytes("fffcc0710eb6cf9efd5b920a8453e1e07157bfff") visit_stats0 = OriginVisitStats( url=url, visit_type="git", last_eventful=date2, last_uneventful=None, last_failed=None, last_notfound=None, last_snapshot=snapshot2, ) swh_scheduler.origin_visit_stats_upsert([visit_stats0]) pk = (url, "git") > actual_visit_stats0 = swh_scheduler.origin_visit_stats_get([pk])[pk] .tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_scheduler.py:890: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .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