Skip to content

Commit

Permalink
ci: ⭐ SIGINT will also kill cometbft, pd, summonerd
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cratelyn committed May 9, 2024
1 parent 5b0baa4 commit d7863a4
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 @@ -51,7 +51,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 @@ -77,7 +77,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 "$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 @@ -107,7 +107,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 "$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 d7863a4

Please sign in to comment.