Skip to content

Commit 1718e85

Browse files
committed
fix: demo-testnet F1 — retry module load + status until clean instead of fixed sleeps (cold daemon boot right after a fresh setup.sh build exceeded the 8s window; verified interactively that the same sequence passes 6/0 once warm)
1 parent 2e06482 commit 1718e85

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

tests/demo-testnet.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ pkill -9 -f "logoscore -D" 2>/dev/null; sleep 2; rm -rf "$HOME/.logoscore"
5050

5151
say "F1 — boot the daemon and load the modules"
5252
RISC0_DEV_MODE=0 "$LOGOSCORE" -D -m "$MODULES_DIR" >/tmp/lp0008-tn-daemon.log 2>&1 & disown
53-
sleep 8
54-
for m in storage_module lez_wallet_module agent_module; do "$LOGOSCORE" load-module "$m" >/dev/null 2>&1; done
55-
sleep 3
56-
LOADED=$("$LOGOSCORE" status 2>/dev/null | python3 -c "import sys,json;d=json.load(sys.stdin)['modules_summary'];print(d['loaded'],d['crashed'])" 2>/dev/null)
57-
echo "$LOADED" | grep -qE "^[0-9]+ 0$" || die "modules did not load cleanly: $LOADED"
53+
# cold boot after a fresh build can exceed a fixed sleep — retry load+status until clean
54+
LOADED=""
55+
for i in $(seq 1 12); do
56+
sleep 8
57+
for m in storage_module lez_wallet_module agent_module; do "$LOGOSCORE" load-module "$m" >/dev/null 2>&1; done
58+
sleep 3
59+
LOADED=$("$LOGOSCORE" status 2>/dev/null | python3 -c "import sys,json;d=json.load(sys.stdin)['modules_summary'];print(d['loaded'],d['crashed'])" 2>/dev/null)
60+
echo "$LOADED" | grep -qE "^[3-9] 0$" && break
61+
done
62+
echo "$LOADED" | grep -qE "^[3-9] 0$" || die "modules did not load cleanly: $LOADED"
5863
ok "modules loaded (loaded crashed): $LOADED"
5964

6065
say "F2 — the agent's own shielded account + point its wallet at the testnet"
@@ -65,9 +70,12 @@ echo "{\"sequencer_addr\":\"$TESTNET\",\"seq_poll_timeout\":\"60s\",\"seq_tx_pol
6570
# restart so the module picks up the testnet endpoint
6671
pkill -9 -f "logoscore -D" 2>/dev/null; sleep 3
6772
RISC0_DEV_MODE=0 "$LOGOSCORE" -D -m "$MODULES_DIR" >/tmp/lp0008-tn-daemon2.log 2>&1 & disown
68-
sleep 8
69-
for m in storage_module lez_wallet_module agent_module; do "$LOGOSCORE" load-module "$m" >/dev/null 2>&1; done
70-
sleep 3
73+
for i in $(seq 1 12); do
74+
sleep 8
75+
for m in storage_module lez_wallet_module agent_module; do "$LOGOSCORE" load-module "$m" >/dev/null 2>&1; done
76+
sleep 3
77+
"$LOGOSCORE" status 2>/dev/null | python3 -c "import sys,json;d=json.load(sys.stdin)['modules_summary'];exit(0 if d['loaded']>=3 and d['crashed']==0 else 1)" 2>/dev/null && break
78+
done
7179
"$LOGOSCORE" call lez_wallet_module ensure_account >/dev/null 2>&1; sleep 2
7280
read -r ANPK AVPK < <("$LOGOSCORE" call agent_module agent_card 2>&1 | python3 -c "import sys,json
7381
d=json.load(sys.stdin); r=json.loads(d['result'])['result']; i=r.get('x-lez-identity',{})

0 commit comments

Comments
 (0)