Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
ab17f37c
Commit
ab17f37c
authored
Jun 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bc4bb76c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+24
-3
No files found.
wcfs/wcfs_test.py
View file @
ab17f37c
...
...
@@ -35,7 +35,7 @@ from ZODB.utils import z64, u64, p64
import
sys
,
os
,
os
.
path
,
subprocess
,
threading
,
inspect
,
traceback
,
re
from
errno
import
EINVAL
from
golang
import
go
,
chan
,
func
,
defer
,
select
from
golang
import
go
,
chan
,
select
,
func
,
defer
from
golang
import
context
,
sync
,
time
from
golang.gcompat
import
qq
from
zodbtools.util
import
ashex
as
h
,
fromhex
...
...
@@ -525,8 +525,19 @@ class tFile:
#
# pinokByWLink: {} tWatchLink -> {} blk -> at.
# pinokByWLink can be None - in that case it is computed automatically.
@
func
def
assertBlk
(
t
,
blk
,
dataok
,
pinokByWLink
=
None
):
print
(
'assertBlk #%d'
%
blk
)
#print('assertBlk #%d' % blk)
# XXX -> assertCtx('blk #%d' % blk)
def
_
():
assertCtx
=
'blk #%d'
%
blk
_
,
e
,
_
=
sys
.
exc_info
()
if
isinstance
(
e
,
AssertionError
):
assert
len
(
e
.
args
)
==
1
# pytest puts everything as args[0]
e
.
args
=
(
assertCtx
+
"
\
n
"
+
e
.
args
[
0
],)
defer
(
_
)
if
not
isinstance
(
dataok
,
bytes
):
dataok
=
dataok
.
encode
(
'utf-8'
)
assert
len
(
dataok
)
<=
t
.
blksize
...
...
@@ -535,8 +546,18 @@ class tFile:
dataok
+=
b'
\
0
'
*
(
t
.
blksize
-
len
(
dataok
))
# tailing zeros
assert
blk
<
t
.
_sizeinblk
()
# access to this block must not trigger access to other blocks
incore_before
=
t
.
cached
()
def
_
():
incore_after
=
t
.
cached
()
incore_before
[
blk
]
=
''
incore_after
[
blk
]
=
''
incore_after
[
-
1
]
=
2.0
# XXX
assert
incore_before
==
incore_after
defer
(
_
)
cached
=
t
.
cached
()[
blk
]
assert
cached
in
(
0
,
1
)
,
"blk #%d"
%
blk
# XXX temp - breaks becuase of kernel readahead
assert
cached
in
(
0
,
1
)
shouldPin
=
False
# whether at least one wlink should receive a pin
# watches must be notified if access goes to @head/file; not if to @rev/file. XXX text
...
...
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