summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 07:10:49 -0300
committerGabriel Schneider <[email protected]>2026-11-20 08:11:40 -0300
commit03afd6e1186c82bccce41566e7044b7f9187f16b (patch)
treeac28f49db5595d4bd96f6b7533932da99047e43c
parent7f306a01bf285689c31b9b6e1ec83341b15ce92c (diff)
downloadpardes-03afd6e1186c82bccce41566e7044b7f9187f16b.tar.gz
pardes-03afd6e1186c82bccce41566e7044b7f9187f16b.zip
test: daemon.py's replica hello sends its first word in the same write, as a client's join does (core/replica.zig joinOn): a refused hello's connection is closed, and the second write met it (BrokenPipeError in replicas(), 1 of 3 plain runs at a load of 37; with 0.5 s between the two writes 2 of 2)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--test/daemon.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/daemon.py b/test/daemon.py
index d134732b..e68cc6ae 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -265,8 +265,11 @@ class Replica:
is read, whole. A daemon of another replica protocol (an older
build's, across an Upgrade) is dialled again in its own."""
name = session.encode()
- self.send(0x01, struct.pack('<HQH', wire or self.WIRE, build, len(name)) + name + b'\xff')
- self.send(0x06, b'\x00')
+ # Its first word (not far) in the same write, as a client's join
+ # sends it (core/replica.zig joinOn): a refused hello's connection
+ # is closed, and a second write after it would meet that.
+ hello = struct.pack('<HQH', wire or self.WIRE, build, len(name)) + name + b'\xff'
+ self.s.sendall(struct.pack('<BI', 0x01, len(hello)) + hello + struct.pack('<BIB', 0x06, 1, 0))
tag, body = self.read()
if tag == 0x01:
pid, n = struct.unpack_from('<IH', body)