Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163632
D2179.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D2179.id.diff
View Options
diff --git a/swh/journal/tests/test_write_replay.py b/swh/journal/tests/test_write_replay.py
--- a/swh/journal/tests/test_write_replay.py
+++ b/swh/journal/tests/test_write_replay.py
@@ -61,16 +61,21 @@
@given(lists(object_dicts(), min_size=1))
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_write_replay_content(objects):
+
queue = []
replayer = MockedJournalClient(queue)
storage1 = Storage()
storage1.journal_writer = MockedKafkaWriter(queue)
+ contents = []
for (obj_type, obj) in objects:
obj = obj.copy()
if obj_type == 'content':
- storage1.content_add([obj])
+ # avoid hash collision
+ if not storage1.content_find(obj):
+ storage1.content_add([obj])
+ contents.append(obj)
queue_size = len(queue)
@@ -82,4 +87,9 @@
while nb_messages < queue_size:
nb_messages += replayer.process(worker_fn)
- assert storage1.objstorage.state == storage2.objstorage.state
+ # only content with status visible will be copied in storage2
+ expected_objstorage_state = {
+ c['sha1']: c['data'] for c in contents if c['status'] == 'visible'
+ }
+
+ assert expected_objstorage_state == storage2.objstorage.state
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 11:29 AM (1 w, 19 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220826
Attached To
D2179: test_write_replay: Handle all possible hypothesis inputs
Event Timeline
Log In to Comment