From bb60e9cb3d0559ee9cdb1faa972726de097a51b0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 22 Nov 2026 22:14:43 -0300 Subject: test/daemon.py far_exec reads the far client's environment once its new image runs: it read /proc/PID/environ as soon as /proc/PID/exe named the new build, and the kernel's exec switches the process to the new image before it writes where the environment is, so a read between gets nothing and the assertion said PARDES_REPLICA_FAR=1 was lost (the install check, 1 of 2; the pair's agent under --with-pair); a client's exec at an Upgrade has one site (runtime/client.zig `execAgain`, from dev/tui/tui.zig and dev/gui/gui.zig) which always adds the variable for a far client; a fork and exec of the release pardes read as the test reads: 170 of 200 execs read the new exe with an empty environment on two CPUs, 0 of 200 on one; far_exec alone on two CPUs before 20 of 20 (the 10 ms poll rarely lands in the window), after 20 of 20; now read after "the terminal entered again" Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/daemon.py b/test/daemon.py index a2a6ae33..9bd0f2cc 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -1321,8 +1321,12 @@ def far_exec(old, new): wait_for('the session exec\'d', lambda: sock.stat().st_ino != ino, timeout=60) nine = reconnect(sock) wait_for('the far client on the new build', lambda: exe_of(c.pid) == (str(binary), True), timeout=30) - assert b'PARDES_REPLICA_FAR=1' in open(f'/proc/{c.pid}/environ', 'rb').read().split(b'\0') if procfs else True wait_for('the terminal entered again', lambda: t.text().rfind(b'\x1b[?1049h') > t.text().rfind(b'\x1b[?1049l') > mark, timeout=30) + # Its environment read once the new image runs (it entered the + # screen): an exec names the new file in /proc/PID/exe before it has + # written where the environment is, and a read between gets nothing + # (two CPUs: 170 execs of 200 read so). + assert b'PARDES_REPLICA_FAR=1' in open(f'/proc/{c.pid}/environ', 'rb').read().split(b'\0') if procfs else True seen = len(checks(check)) key(b'j') wait_for('its key stepped after', lambda: agreed(check, seen + 1), timeout=30) -- cgit v1.3