python: lock before launching pht insert in test

This commit is contained in:
Simon Désaulniers authored and Adrien Béraud committed 2016-09-01 18:02:23 -04:00
1 parent e85a423f6a
commit 4e8408e225
1 file changed
+2 -2
+2 -2
View File
@@ -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__()