diff options
Diffstat (limited to 'test/monkey9p.py')
| -rw-r--r-- | test/monkey9p.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/monkey9p.py b/test/monkey9p.py index 4d190bbc..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: @@ -1615,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) |
