mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-08-07 22:22:36 -04:00
inspect_dht_record python binding fix and integration test fix
This commit is contained in:
parent
be11b4543c
commit
0b0d9b5291
2 changed files with 12 additions and 3 deletions
|
@ -4,6 +4,7 @@ import veilid
|
||||||
import pytest
|
import pytest
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
|
import time
|
||||||
import os
|
import os
|
||||||
from . import *
|
from . import *
|
||||||
from .api import VeilidTestConnectionError, api_connector
|
from .api import VeilidTestConnectionError, api_connector
|
||||||
|
@ -386,10 +387,18 @@ async def test_dht_integration_writer_reader():
|
||||||
records.append(desc)
|
records.append(desc)
|
||||||
|
|
||||||
await rc0.set_dht_value(desc.key, 0, TEST_DATA)
|
await rc0.set_dht_value(desc.key, 0, TEST_DATA)
|
||||||
await rc0.close_dht_record(desc.key)
|
|
||||||
|
|
||||||
print(f' {n}')
|
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
|
# read dht records on server 1
|
||||||
print(f'reading {COUNT} records')
|
print(f'reading {COUNT} records')
|
||||||
n=0
|
n=0
|
||||||
|
|
|
@ -394,7 +394,7 @@ class DHTRecordReport:
|
||||||
network_seqs: list[ValueSeqNum],
|
network_seqs: list[ValueSeqNum],
|
||||||
):
|
):
|
||||||
self.subkeys = subkeys
|
self.subkeys = subkeys
|
||||||
self.offline_subkey = offline_subkeys
|
self.offline_subkeys = offline_subkeys
|
||||||
self.local_seqs = local_seqs
|
self.local_seqs = local_seqs
|
||||||
self.network_seqs = network_seqs
|
self.network_seqs = network_seqs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue