diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-29 17:48:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-29 19:38:53 -0300 |
| commit | 3a5db21504a653cc5e97b98edad59a6262a3b8e9 (patch) | |
| tree | dd07f6e0d77c22623832ca549e2fbdf176b55c01 /test/daemon.py | |
| parent | 2cce341e2c94fb3150dc1f3e7911c26502a70487 (diff) | |
| download | pardes-3a5db21504a653cc5e97b98edad59a6262a3b8e9.tar.gz pardes-3a5db21504a653cc5e97b98edad59a6262a3b8e9.zip | |
views: a view drawn while another is live takes no post_present (its acknowledgement moved the live session's pointer and hover, and a replica that draws nothing applied it to another view); daemon.py attaches a second terminal and a second window beside the first; views-term.snap pins a terminal shown at two sizes
Found by `pardes-monkey --views=3 --tape`: 4 of 6 seeds diverged at acknowledge_panel_presentation inside the pump, the recording having moved the look-hover of the view it drew and the headless replica that of the live one. A view's panels are acknowledged when it is live and drawn. With it, 6 of 6 seeds replay in all three replicas.
test/daemon.py: with the first terminal attached, a second `pardes --attach` gets a view of its own; both are drawn (a line run in the shell shows in each), then it is detached from inside (its stub ends 0, the first draws on) and, again, its terminal closed outright; fds of the session and the daemon level. --gui: a second `pardes-gui --attach` while the window is open opens another (its captures under view-1), and Detach closes only it. views-term.snap: a terminal typed into from the big view is sized for it and shown at that size in the small one, then the other way round. ponytail noted at Pardes.sizes: a view smaller than the terminal shows its top rows.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/daemon.py')
| -rw-r--r-- | test/daemon.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/daemon.py b/test/daemon.py index 04455f0f..41cfbaf7 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -212,11 +212,13 @@ def main(binary, cycles): # (src/views.zig), drawn beside the first. Detached from inside, its # stub ends and the first draws on; closed outright, the same. for how in ('detach', 'close'): - term2 = Term(20, 60) + # Bigger than the first: the shell, sized for the first (its + # last typist), shows whole in it. + term2 = Term(40, 120) stub2 = term2.spawn([binary, '--attach=work'], env) started.append(stub2.pid) wait_for('the second terminal\'s first frame', lambda: b'\x1b[?1049h' in term2.text()) - wait_for('the second terminal\'s view live', lambda: client.screen()['cols'] == 60) + wait_for('the second terminal\'s view live', lambda: client.screen()['cols'] == 120) seen = len(term.text()) run(client, shell, f'echo both-drawn-{how}\n'.encode()) wait_for('the first terminal drawn', lambda: f'both-drawn-{how}'.encode() in term.text()[seen:]) @@ -230,7 +232,7 @@ def main(binary, cycles): term2.close() else: term2.close() - assert stub2.wait(timeout=10) != 0 or True + stub2.wait(timeout=10) wait_for('the first terminal\'s view live again', lambda: client.screen()['cols'] == 100) seen = len(term.text()) run(client, shell, f'echo first-on-{how}\n'.encode()) @@ -359,6 +361,17 @@ def gui(binary, cycles): baseline = baseline or now assert now == baseline, (cycle, now, baseline) print(f'daemon: {cycles} window detach/attach cycles, fds/processes level: {baseline}') + # Attached already: another window, a view of its own (its test + # captures under view-1); Detach in it closes only it. + attach = subprocess.run([binary, '--attach=win'], env=env, cwd=root, timeout=10, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + assert attach.returncode == 0, attach.stderr + wait_for('the second window drawn', lambda: (root / 'caps' / 'view-1' / 'latest.ppm').exists()) + client.write(f'/pane/{shell}/exec', b'Detach\n') + time.sleep(.5) + assert not sized(client), 'the first window stays' + assert proc.poll() is None + print('daemon: a second window on an attached window session, detached alone') # Another kind is refused in words, and so is a name nobody has. client.write(f'/pane/{shell}/exec', b'Detach\n') wait_for('the window closed', lambda: sized(client)) |
