mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
fix(cordn): the interop harness needed a timeout macOS does not have
`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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
d627ba7846
commit
74d8462ba9
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user