Skip to content
Snippets Groups Projects
Commit afb7e1b8 authored by Simon Désaulniers's avatar Simon Désaulniers Committed by Adrien Béraud
Browse files

python: lock before launching pht insert in test

parent 0dc7d272
No related branches found
No related tags found
No related merge requests found
...@@ -277,15 +277,15 @@ class PhtTest(FeatureTest): ...@@ -277,15 +277,15 @@ class PhtTest(FeatureTest):
# Index all entries. # Index all entries.
for key in keys: for key in keys:
PhtTest.key = key PhtTest.key = key
pht.insert(key, IndexValue(random_hash()), PhtTest.insertDoneCb)
with FeatureTest.lock: with FeatureTest.lock:
pht.insert(key, IndexValue(random_hash()), PhtTest.insertDoneCb)
FeatureTest.lock.wait() FeatureTest.lock.wait()
# Recover entries now that the trie is complete. # Recover entries now that the trie is complete.
for key in keys: for key in keys:
PhtTest.key = key PhtTest.key = key
pht.lookup(key, PhtTest.lookupCb, PhtTest.lookupDoneCb)
with FeatureTest.lock: with FeatureTest.lock:
pht.lookup(key, PhtTest.lookupCb, PhtTest.lookupDoneCb)
FeatureTest.lock.wait() FeatureTest.lock.wait()
all_entries[PhtTest.prefix] = [e.__str__() all_entries[PhtTest.prefix] = [e.__str__()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment