summaryrefslogtreecommitdiff
path: root/test/daemon.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 22:14:43 -0300
committerGabriel Schneider <[email protected]>2026-11-22 22:44:21 -0300
commitbb60e9cb3d0559ee9cdb1faa972726de097a51b0 (patch)
tree65f6b7df434749cc8748ac0a0b397466bdf09541 /test/daemon.py
parent111e53418c72717cb1decf56767d2f79188cf9fc (diff)
downloadpardes-bb60e9cb3d0559ee9cdb1faa972726de097a51b0.tar.gz
pardes-bb60e9cb3d0559ee9cdb1faa972726de097a51b0.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/daemon.py')
-rw-r--r--test/daemon.py6
1 files changed, 5 insertions, 1 deletions
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)