Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_retry::test_retrying_proxy_storage_content_add_metadata_with_retry
Failed

TEST RESULT

Run At
Jul 21 2020, 3:06 PM
Details
monkeypatch_sleep = <_pytest.monkeypatch.MonkeyPatch object at 0x7fd494ff1208> swh_storage = <swh.storage.retry.RetryingProxyStorage object at 0x7fd494ff1588> sample_data_model = {'authority': [MetadataAuthority(type=<MetadataAuthorityType.DEPOSIT_CLIENT: 'deposit_client'>, url='http://hal.inria.... perms=<DentryPerms.directory: 16384>),), id=b'7z\xa5\xfc\xd9D\xfb\xab\xf5\x02\xdb\xfd\xa5\\\xd1M3\xc8\xc3\xc6')], ...} mocker = <pytest_mock.plugin.MockFixture object at 0x7fd495091630> fake_hash_collision = HashCollision('sha1', '38762cf7f55934b34d179ae6a4c80cadccbb7f0a', []) def test_retrying_proxy_storage_content_add_metadata_with_retry( monkeypatch_sleep, swh_storage, sample_data_model, mocker, fake_hash_collision ): """Multiple retries for hash collision and psycopg2 error but finally ok """ mock_memory = mocker.patch( "swh.storage.in_memory.InMemoryStorage.content_add_metadata" ) mock_memory.side_effect = [ # first try goes ko fake_hash_collision, # second try goes ko psycopg2.IntegrityError("content_metadata already inserted"), # ok then! {"content:add": 1}, ] > sample_content = sample_data_model["content_no_data"][0] E KeyError: 'content_no_data' .tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_retry.py:154: KeyError