Skip to content

Commit

Permalink
ci: πŸ“ž smoke-summoner.sh signal handling fixes
Browse files Browse the repository at this point in the history
this squashes two related commits from development:

---

ci: ⭐ `SIGINT` will also kill cometbft, pd, summonerd

when running this locally in a development shell, i found that `ctrl+c`
would not terminate the other running processes. this would stop the
shell script, but logs from pd and cometbft would continue being printed
to the screen.

moreover, after stopping that shell, `ps` showed me that these processes
were left running, causing subsequent runs of the summonerd smoke test
to fail due to ports already being bound.

this adds `SIGINT` to the list of signals that will bring down the
cometbft, pd, and summonerd processes. this way, `ctrl+c` will properly
clean things up.

---

ci: βž• don't clobber smoke test's child pids

fixes #4370.

this makes the list of process id's provided to `kill -9` when a SIGEXIT
or SIGINT signal is received an _additive_ list. prior, we were
clobbering this list when the phase1 and phase2 steps were run.

now, we append a new id to the list at each point we set a signal
trap.
  • Loading branch information
cratelyn committed May 10, 2024
1 parent c51d919 commit e3493cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deployments/scripts/smoke-summoner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ cargo run --quiet --release --bin pd -- start --home "${HOME}/.penumbra/testnet_
pd_pid="$!"

# Ensure processes are cleaned up after script exits, regardless of status.
trap 'kill -9 "$cometbft_pid" "$pd_pid"' EXIT
trap 'kill -9 "$cometbft_pid" "$pd_pid"' EXIT INT

echo "Waiting $TESTNET_BOOTTIME seconds for network to boot..."
sleep "$TESTNET_BOOTTIME"
Expand All @@ -93,7 +93,7 @@ echo "Starting phase 1 run..."
cargo run --quiet --release --bin summonerd -- start --phase 1 --storage-dir /tmp/summonerd --fvk $SUMMONER_FVK --node http://127.0.0.1:8080 --bind-addr 127.0.0.1:8082 &
phase1_pid="$!"
# If script ends early, ensure phase 1 is halted.
trap 'kill -9 "$phase1_pid"' EXIT
trap 'kill -9 "$cometbft_pid" "$pd_pid" "$phase1_pid"' EXIT INT

echo "Setting up test accounts..."
# We are returning 0 always here because the backup wallet file does not respect the location of
Expand Down Expand Up @@ -123,7 +123,7 @@ echo "Starting phase 2 run..."
cargo run --quiet --release --bin summonerd -- start --phase 2 --storage-dir /tmp/summonerd --fvk $SUMMONER_FVK --node http://127.0.0.1:8080 --bind-addr 127.0.0.1:8082 &
phase2_pid="$!"
# If script ends early, ensure phase 2 is halted.
trap 'kill -9 "$phase2_pid"' EXIT
trap 'kill -9 "$cometbft_pid" "$pd_pid" "$phase1_pid" "$phase2_pid' EXIT INT

echo "Phase 2 contributions..."
cargo run --quiet --release --bin pcli -- --home /tmp/account1 ceremony contribute --coordinator-url http://127.0.0.1:8082 --coordinator-address $SUMMONER_ADDRESS --phase 2 --bid 10penumbra
Expand Down

0 comments on commit e3493cc

Please sign in to comment.