diff --git a/veilid-python/tests/test_dht.py b/veilid-python/tests/test_dht.py index 9cad70ca..779ffa95 100644 --- a/veilid-python/tests/test_dht.py +++ b/veilid-python/tests/test_dht.py @@ -4,6 +4,7 @@ import veilid import pytest import asyncio import json +import time import os from . import * from .api import VeilidTestConnectionError, api_connector @@ -386,10 +387,18 @@ async def test_dht_integration_writer_reader(): records.append(desc) await rc0.set_dht_value(desc.key, 0, TEST_DATA) - await rc0.close_dht_record(desc.key) - + print(f' {n}') + print(f'syncing records to the network') + for desc0 in records: + while True: + rr = await rc0.inspect_dht_record(desc0.key, []) + if len(rr.offline_subkeys) == 0: + await rc0.close_dht_record(desc0.key) + break + time.sleep(0.1) + # read dht records on server 1 print(f'reading {COUNT} records') n=0 diff --git a/veilid-python/veilid/types.py b/veilid-python/veilid/types.py index 630c1bc4..56e52002 100644 --- a/veilid-python/veilid/types.py +++ b/veilid-python/veilid/types.py @@ -394,7 +394,7 @@ class DHTRecordReport: network_seqs: list[ValueSeqNum], ): self.subkeys = subkeys - self.offline_subkey = offline_subkeys + self.offline_subkeys = offline_subkeys self.local_seqs = local_seqs self.network_seqs = network_seqs