Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
neoppod
Commits
7834ef10
Commit
7834ef10
authored
Dec 17, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: more comments to testExternalInvalidation
parent
17e5ac38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+10
-2
No files found.
neo/tests/threaded/test.py
View file @
7834ef10
...
@@ -586,6 +586,7 @@ class Test(NEOThreadedTest):
...
@@ -586,6 +586,7 @@ class Test(NEOThreadedTest):
l1
.
release
()
l1
.
release
()
l2
.
acquire
()
l2
.
acquire
()
x2
.
_p_deactivate
()
x2
.
_p_deactivate
()
# Remove last version of x from cache
cache
.
_remove
(
cache
.
_oid_dict
[
x2
.
_p_oid
].
pop
())
cache
.
_remove
(
cache
.
_oid_dict
[
x2
.
_p_oid
].
pop
())
p
=
Patch
(
cluster
.
client
,
_loadFromStorage
=
_loadFromStorage
)
p
=
Patch
(
cluster
.
client
,
_loadFromStorage
=
_loadFromStorage
)
try
:
try
:
...
@@ -593,13 +594,13 @@ class Test(NEOThreadedTest):
...
@@ -593,13 +594,13 @@ class Test(NEOThreadedTest):
l1
.
acquire
()
l1
.
acquire
()
# At this point, x could not be found the cache and the result
# At this point, x could not be found the cache and the result
# from the storage (which is <value=1, next_tid=None>) is about
# from the storage (which is <value=1, next_tid=None>) is about
# to processed.
# to
be
processed.
# Now modify x to receive an invalidation for it.
# Now modify x to receive an invalidation for it.
cluster
.
client
.
setPoll
(
0
)
cluster
.
client
.
setPoll
(
0
)
client
.
setPoll
(
1
)
client
.
setPoll
(
1
)
txn
=
transaction
.
Transaction
()
txn
=
transaction
.
Transaction
()
client
.
tpc_begin
(
txn
)
client
.
tpc_begin
(
txn
)
client
.
store
(
x2
.
_p_oid
,
tid
,
x
,
''
,
txn
)
client
.
store
(
x2
.
_p_oid
,
tid
,
x
,
''
,
txn
)
# value=0
tid
=
client
.
tpc_finish
(
txn
,
None
)
tid
=
client
.
tpc_finish
(
txn
,
None
)
client
.
setPoll
(
0
)
client
.
setPoll
(
0
)
cluster
.
client
.
setPoll
(
1
)
cluster
.
client
.
setPoll
(
1
)
...
@@ -613,6 +614,10 @@ class Test(NEOThreadedTest):
...
@@ -613,6 +614,10 @@ class Test(NEOThreadedTest):
self
.
assertEqual
(
x2
.
value
,
1
)
self
.
assertEqual
(
x2
.
value
,
1
)
self
.
assertEqual
(
x1
.
value
,
0
)
self
.
assertEqual
(
x1
.
value
,
0
)
# l1 is acquired and l2 is released
# Change x again from 0 to 1, while the checking connection c1
# is suspended at the beginning of the transaction t1,
# between Storage.sync() and flush of invalidations.
def
_flush_invalidations
(
orig
):
def
_flush_invalidations
(
orig
):
l1
.
release
()
l1
.
release
()
l2
.
acquire
()
l2
.
acquire
()
...
@@ -636,6 +641,9 @@ class Test(NEOThreadedTest):
...
@@ -636,6 +641,9 @@ class Test(NEOThreadedTest):
del
p
del
p
l2
.
release
()
l2
.
release
()
t
.
join
()
t
.
join
()
# A transaction really begins when it acquires the lock to flush
# invalidations. The previous lastTransaction() only does a ping
# to make sure we have a recent enough view of the DB.
self
.
assertEqual
(
x1
.
value
,
1
)
self
.
assertEqual
(
x1
.
value
,
1
)
finally
:
finally
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment