mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
python: lock before launching pht insert in test
This commit is contained in:
1 parent
e85a423f6a
commit
4e8408e225
1 file changed
+2
-2
@@ -308,15 +308,15 @@ class PhtTest(FeatureTest):
|
||||
# Index all entries.
|
||||
for key in keys:
|
||||
PhtTest.key = key
|
||||
pht.insert(key, IndexValue(random_hash()), PhtTest.insertDoneCb)
|
||||
with FeatureTest.lock:
|
||||
pht.insert(key, IndexValue(random_hash()), PhtTest.insertDoneCb)
|
||||
FeatureTest.lock.wait()
|
||||
|
||||
# Recover entries now that the trie is complete.
|
||||
for key in keys:
|
||||
PhtTest.key = key
|
||||
pht.lookup(key, PhtTest.lookupCb, PhtTest.lookupDoneCb)
|
||||
with FeatureTest.lock:
|
||||
pht.lookup(key, PhtTest.lookupCb, PhtTest.lookupDoneCb)
|
||||
FeatureTest.lock.wait()
|
||||
|
||||
all_entries[PhtTest.prefix] = [e.__str__()
|
||||
|
||||
Reference in new issue
Block a user