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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
6dc5272d
Commit
6dc5272d
authored
Jun 20, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
82f13653
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+16
-4
No files found.
wcfs/wcfs_test.py
View file @
6dc5272d
...
@@ -136,9 +136,11 @@ def timeout(parent=context.background()): # -> ctx
...
@@ -136,9 +136,11 @@ def timeout(parent=context.background()): # -> ctx
ctx
,
_
=
with_timeout
()
ctx
,
_
=
with_timeout
()
return
ctx
return
ctx
# XXX
# tdelay is used in places where we need to delay a bit in order to e.g. raise
# probability of a bug due to race condition.
def
tdelay
():
def
tdelay
():
time
.
sleep
(
1
*
time
.
millisecond
)
# XXX -> 10ms ?
time
.
sleep
(
10
*
time
.
millisecond
)
# DF represents a change in files space.
# DF represents a change in files space.
# it corresponds to ΔF in wcfs.go .
# it corresponds to ΔF in wcfs.go .
...
@@ -163,9 +165,19 @@ class DFile:
...
@@ -163,9 +165,19 @@ class DFile:
# BigFiles opened under tDB are represented as tFile - see .open for details.
# BigFiles opened under tDB are represented as tFile - see .open for details.
# Watches opened under tDB are represented as tWatchLink - see .openwatch for details.
# Watches opened under tDB are represented as tWatchLink - see .openwatch for details.
#
#
# XXX .root + .wc
#
# XXX .change + .commit
# XXX .dFtail + .head
# + .iter_revv
#
# XXX .open -> .topen
# XXX .open -> .topen
# XXX .openwatch -> .topenwatch ?
# XXX .openwatch -> .topenwatch ?
#
#
# XXX .close
#
# XXX .path/.read/.stat/._open
#
# XXX print -> t.trace/debug() + t.verbose depending on py.test -v -v ?
# XXX print -> t.trace/debug() + t.verbose depending on py.test -v -v ?
class
tDB
:
class
tDB
:
def
__init__
(
t
):
def
__init__
(
t
):
...
@@ -649,7 +661,7 @@ class tWatch:
...
@@ -649,7 +661,7 @@ class tWatch:
# tWatchLink provides testing environment for /head/watch link opened on wcfs.
# tWatchLink provides testing environment for /head/watch link opened on wcfs.
#
#
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
# .watch() setups/adjusts a watch for a file and verifies that wcfs
sends correct
initial pins.
# .watch() setups/adjusts a watch for a file and verifies that wcfs
correctly sends
initial pins.
class
tWatchLink
:
class
tWatchLink
:
def
__init__
(
t
,
tdb
):
def
__init__
(
t
,
tdb
):
...
@@ -927,7 +939,7 @@ def _pinAt(t, zf, at): # -> pin = {} blk -> rev
...
@@ -927,7 +939,7 @@ def _pinAt(t, zf, at): # -> pin = {} blk -> rev
# pinok: {} blk -> rev
# pinok: {} blk -> rev
# pinok can be None - in that case it is computed automatically.
# pinok can be None - in that case it is computed automatically.
@
func
(
tWatchLink
)
@
func
(
tWatchLink
)
def
watch
(
twlink
,
zf
,
at
,
pinok
=
None
):
# XXX -> ?
def
watch
(
twlink
,
zf
,
at
,
pinok
=
None
):
# XXX ->
tWatch
?
t
=
twlink
.
tdb
t
=
twlink
.
tdb
w
=
twlink
.
_watching
.
get
(
zf
)
w
=
twlink
.
_watching
.
get
(
zf
)
if
w
is
None
:
if
w
is
None
:
...
...
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