From 74d8462ba9dcde90ccf48280d170837b9e83ae1e Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 23 Sep 2026 19:06:50 -0400 Subject: [PATCH] fix(cordn): the interop harness needed a timeout macOS does not have MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ref()` wrapped the reference client in `timeout 120`. That is GNU coreutils, which macOS does not ship, so every call to it failed with "command not found" — and because ref() folds stderr into the output it parses for `key: value`, the run died at the first one with only could not read the reference client's pubkey which names the wrong thing entirely. Resolved once up front: `timeout`, else `gtimeout` for whoever has coreutils from Homebrew, else untimed with a note. A harness that runs untimed still tests the protocol; one that cannot start tests nothing. With this, `interop-client.sh` reaches CLIENT INTEROP PASSED — ts-mls opens our Welcome, applies our public-framed Commit, and all three members agree at epoch 2. Co-Authored-By: Claude Opus 5 (1M context) --- cli/tests/cordn/interop-client.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cli/tests/cordn/interop-client.sh b/cli/tests/cordn/interop-client.sh index 7d683b0839..89ee63ab2a 100755 --- a/cli/tests/cordn/interop-client.sh +++ b/cli/tests/cordn/interop-client.sh @@ -67,6 +67,21 @@ trap stack_down EXIT stack_require command -v npm >/dev/null 2>&1 || { echo "npm is needed to install @cordn/cli"; exit 2; } +# A stuck reference client should fail the run rather than hang it, but macOS +# ships no `timeout` (it is GNU coreutils; `gtimeout` if Homebrew installed +# them). Without this the whole harness died at the first `ref` call with +# nothing but "could not read the reference client's pubkey", because ref() +# folds stderr into the output it parses and "command not found" matches no +# field. Running untimed is better than not running. +if command -v timeout >/dev/null 2>&1; then + REF_TIMEOUT="timeout 120" +elif command -v gtimeout >/dev/null 2>&1; then + REF_TIMEOUT="gtimeout 120" +else + REF_TIMEOUT="" + echo "note: no timeout(1) — the reference client runs untimed" +fi + step "boot geode on $RELAY and the reference coordinator" stack_up ok "coordinator $COORD" @@ -88,7 +103,8 @@ ok "$("$CORDN" --version 2>/dev/null || echo unknown)" amy() { HOME="$WORK/amy" "$AMY" --account a --secret-backend ncryptsec "$@" 2>/dev/null; } amy2() { HOME="$WORK/amy2" "$AMY" --account b --secret-backend ncryptsec "$@" 2>/dev/null; } ref() { - timeout 120 "$CORDN" \ + # shellcheck disable=SC2086 # REF_TIMEOUT is a command prefix, or empty + $REF_TIMEOUT "$CORDN" \ --private-key-file "$WORK/ref.key" \ --server-pubkey "$COORD" \ --relay "$RELAY" \