Commit 82f13653 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent afef5ec0
......@@ -127,9 +127,8 @@ def test_join_autostart():
# ---- infrastructure for data access tests ----
# XXX place=?
# many tests need to be run with some reasonable timeout to detect lack of wcfs
# response. with_timout and timeout provides syntatic shortcuts to do so.
# response. with_timeout and timeout provide syntactic shortcuts to do so.
def with_timeout(parent=context.background()): # -> ctx, cancel
return context.with_timeout(parent, 3*time.second)
......@@ -438,7 +437,7 @@ class tFile:
blkmmap = t.fmmap[blk*t.blksize:(blk+1)*t.blksize]
# NOTE the kernel does not start readahead from access to
# MADV_RANDOM vma, but for a MADV_{NORMAL/SEQUENTIAL} vma it starts
# readhead which can go _beyond_ vma that was used to decide RA
# readahead which can go _beyond_ vma that was used to decide RA
# start. For this reason - to prevent RA started at one block to
# overlap with the next block, we put MADV_RANDOM vma at the end of
# every block covering last 1/8 of it.
......@@ -557,6 +556,7 @@ class tFile:
assert cached == 0
# even if @head[blk] is uncached, the block could be
# already pinned by setup watch
# XXX assert blkaccessed.rev > w.at => w.pinned
if blk not in w.pinned:
pinok = {blk: t.tdb._blkRev(t.zf, blk, w.at)}
shouldPin = True
......@@ -578,7 +578,7 @@ class tFile:
ev.append('read pre')
# access data with released GIL so that the thread that reads data from
# head/watch can receive pin message. Be careful to handle cancelation,
# head/watch can receive pin message. Be careful to handle cancellation,
# so that on error in another worker we don't get stuck and the
# error can be propagated to wait and reported.
have_read = chan(1)
......@@ -710,7 +710,7 @@ class tWatchLink:
t._serveCancel()
# XXX we can get stuck here if wcfs does not behave as we want.
# XXX in particular if there is a silly - e.g. syntax or type error in
# test code - we curently get stuck here.
# test code - we currently get stuck here.
#
# XXX -> better pthread_kill(SIGINT) instead of relying on wcfs proper behaviour?
try:
......@@ -1048,7 +1048,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
# Use timeout to detect wcfs replying less pins than expected.
#
# XXX detect not sent pins via ack'ing previous pins as they come in (not
# waiting for all of them) and then seeing that we did not received expeced
# waiting for all of them) and then seeing that we did not received expected
# pin when f completes?
ctx, cancel = with_timeout()
wg = sync.WorkGroup(ctx)
......@@ -1122,7 +1122,7 @@ def _expectPin(twlink, ctx, zf, expect): # -> []tSrvReq
try:
req = twlink.recvReq(ctx)
except Exception as e:
raise RuntimeError("%s\nnot all pin missages received - pending:\n%s" % (e, expected))
raise RuntimeError("%s\nnot all pin messages received - pending:\n%s" % (e, expected))
assert req is not None # channel not closed
assert req.msg in expected
expected.remove(req.msg)
......@@ -1412,7 +1412,7 @@ def test_wcfs():
# XXX blk not initially covered by f.δtail (blk never accessed - f.δtail
# not updated on invalidation). then blk is accessed - what happens with
# watch that should be triggerring for this blk?
# watch that should be triggering for this blk?
# XXX similar to ^^^ but with two changes to blk not covered by f.δtail. To
# which @rev blk is pinned on watch? (δtail is missing both and if it will
......@@ -1523,7 +1523,7 @@ def dump_history(t):
#
# if deferred function raises exception itself - it prints previous exception to stderr.
#
# XXX xdefer is workaround for Python2 not having exception chanining (PEP 3134)
# XXX xdefer is workaround for Python2 not having exception chaining (PEP 3134)
# without which, if e.g. tDB.close() raises exception, it prevents to see
# whether and which an assert in the test failed.
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment