replayer_storage_and_client = (<swh.storage.in_memory.InMemoryStorage object at 0x7f60838f57f0>, <swh.journal.client.JournalClient object at 0x7f6058303630>)
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f605724f278>
def test_storage_replayer(replayer_storage_and_client, caplog):
"""Optimal replayer scenario.
This:
- writes objects to a source storage
- replayer consumes objects from the topic and replays them
- a destination storage is filled from this
In the end, both storages should have the same content.
"""
src, replayer = replayer_storage_and_client
# Fill Kafka using a source storage
nb_sent = 0
for object_type, objects in TEST_OBJECTS.items():
method = getattr(src, object_type + "_add")
> method(objects)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_replay.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f60838f57f0>
ids = [ExtID(extid_type='git256', extid=b'\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x...', object_type=<ObjectType.REVISION: 'rev'>), id=b'\xb6\xf9ap\x1a\xf5\x89\xea{\xeb\xf8\xf8\xea\x85\x9e\x0b\xc6\xe8#:')]
def extid_add(self, ids: List[ExtID]) -> Dict[str, int]:
if not self._allow_overwrite:
extids = [
extid
for extid in ids
if not self._cql_runner.extid_get_from_pk(
extid_type=extid.extid_type, extid=extid.extid, target=extid.target,
)
]
> self.journal_writer.extid_add(extids)
E UnboundLocalError: local variable 'extids' referenced before assignment
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:1398: UnboundLocalError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 11:06 AM