Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
afb7e1b8
Commit
afb7e1b8
authored
9 years ago
by
Simon Désaulniers
Committed by
Adrien Béraud
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
python: lock before launching pht insert in test
parent
0dc7d272
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tools/dht/tests.py
+2
-2
2 additions, 2 deletions
python/tools/dht/tests.py
with
2 additions
and
2 deletions
python/tools/dht/tests.py
+
2
−
2
View file @
afb7e1b8
...
@@ -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__
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment