diff options
Diffstat (limited to 'test/selfmount.py')
| -rw-r--r-- | test/selfmount.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/selfmount.py b/test/selfmount.py index 503ce1e0..6b9d8740 100644 --- a/test/selfmount.py +++ b/test/selfmount.py @@ -196,6 +196,16 @@ def run(binary): looped.unlink(missing_ok=True) check(ran == '0' and got_line.startswith('FX') and got_line.rstrip().endswith('Msg ev-loop'), f'a bash read loop on event reads a whole record ({got_line!r})') + # Past the session's 64 open records (write opens of exec take + # them too) an open is refused EMFILE, "Too many open files". + # (>> here: a truncating open of exec through the mount can + # hang, reported, not yet understood.) + many = Path(f'/tmp/{name}.many') + ran = run((f"timeout 10 bash -c 'for i in $(seq 80); do exec {{fd}}>>{mount}/exec || exit 9; done' 2> {many}; " + f"st=$?; echo rc=$st >> {many}; exit $st\n").encode()) + said_many = many.read_text() if many.exists() else '' + many.unlink(missing_ok=True) + check(ran == '9' and 'Too many open files' in said_many, f'an open past the 64 records is EMFILE ({ran!r}, {said_many[-80:]!r})') client.write('/exec', b'Msg still here\n') text = ''.join(cell[0] for cell in client.screen()['cells']) check('still here' in text, 'the editor answers after all of that') |
