summaryrefslogtreecommitdiff
path: root/test/monkey9p.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/monkey9p.py')
-rw-r--r--test/monkey9p.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/monkey9p.py b/test/monkey9p.py
index 7ab6cb0c..87e386b3 100644
--- a/test/monkey9p.py
+++ b/test/monkey9p.py
@@ -674,8 +674,9 @@ def served_lines(data, sizes, room):
(fs.md, tree.zig write): each ended line, and the unended tail of a piece
shorter than a Twrite holds (`room`, msize less 24), which is whole in
itself, as acme takes each write; a piece that fills its Twrite may go
- on, and its tail waits for the next. A line written a byte a Twrite is
- so as many lines as bytes."""
+ on, and its tail waits for the next, and so does one of a multiple of
+ 4096 bytes, where a writer's buffer filled. A line written a byte a
+ Twrite is so as many lines as bytes."""
lines, pending, at = [], b'', 0
for size in sizes:
piece = data[at:at + size]
@@ -683,7 +684,7 @@ def served_lines(data, sizes, room):
pending += piece
*done, pending = pending.split(b'\n')
lines += done
- if pending and len(piece) < room:
+ if pending and len(piece) < room and len(piece) % 4096 != 0:
lines.append(pending)
pending = b''
if pending:
@@ -1518,6 +1519,9 @@ def one_failure_rule(ctx, res):
# line cut across Twrites runs a piece a Twrite, and a piece that ran
# (a Save) says so while a later one is refused.
succeeded = [w for w in writes if w[2] is True and w[0] == 'write']
+ # A file watch's notice (`<file> deleted on disk ...`, `changed on
+ # disk`) is the host's news, said whenever it arrives: no write's.
+ msgs = [m for m in msgs if ' deleted on disk (' not in m and ' changed on disk (' not in m]
if failed and msgs and not succeeded:
return f'a failed write also logged msg: {msgs}; failed={[(w[1], w[3]) for w in failed]}'
return None
@@ -1612,7 +1616,10 @@ def chunked_equals_whole(ctx, res):
whole_n, chunk_n = dir_names(whole), dir_names(chunked)
if whole_n != chunk_n:
return f'{path}: whole {whole_n} != chunked({size}) {chunk_n}'
- elif whole != chunked:
+ elif whole != chunked and w.read_all(fid) != chunked:
+ # A live file (a tag says `running`, then `exit 0`) may change
+ # between the two reads: only chunks that no whole read matches,
+ # read again, are a chunking fault.
return f'{path}: whole {whole[:200]!r} != chunked({size}) {chunked[:200]!r}'
finally:
w.clunk(fid)