diff options
Diffstat (limited to 'test/selfmount.py')
| -rw-r--r-- | test/selfmount.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/selfmount.py b/test/selfmount.py index 6b9d8740..ddfb77dc 100644 --- a/test/selfmount.py +++ b/test/selfmount.py @@ -169,6 +169,19 @@ def run(binary): check(run(f'python3 -c "{maker}" > {mount}/pane/{scratch}/ctl\n'.encode()) == '0', 'a 50 KB Edit block written through the mount') body = client.read(f'/pane/{scratch}/body').decode().splitlines() check(body == ['line %05d of the block' % i for i in range(2500)], f'it ran once, whole ({len(body)} lines)') + # One 600 KiB line: 9ns sends it as 65512-byte Twrites, the last + # one short, and none is taken for a whole line by its size. + errs = client.read('/log').decode().count('\nerr ') + long_edit = "import sys; sys.stdout.write('Edit ,c/' + 'q' * 600000 + '/\\n')" + check(run(f'python3 -c "{long_edit}" > {mount}/pane/{scratch}/ctl\n'.encode()) == '0', 'a 600 KiB Edit line written through the mount') + check(client.read(f'/pane/{scratch}/body') == b'q' * 600000, 'it ran once, whole') + check(client.read('/log').decode().count('\nerr ') == errs, 'no piece of it was refused as a line of its own') + # Over 1 MiB: refused once, its tail dropped through its newline. + too_long = "import sys; sys.stdout.write('Msg ' + 'z' * 1150000 + '\\nMsg after-long\\n')" + run(f'python3 -c "{too_long}" > {mount}/exec\n'.encode()) + log = client.read('/log').decode() + check(log.count('over 1 MiB') == 1 and 'unknown control message' not in log and 'after-long' in log, + 'a 1.1 MiB line is refused once, its tail never a line, the next line runs') # Forty event reads held through the mount, a follower each, and # the mount still answers the rest: 9ns keeps workers past what # the editor holds (128), so `cat layout` is not queued behind |
