Skip to content

Commit

Permalink
use trap to shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-ogrady committed Jan 9, 2023
1 parent 84815ab commit e95f50e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions scripts/tests.e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ server \
#--disable-nodes-output \
PID=${!}

function cleanup()
{
echo "shutting down network runner"
kill ${PID}
}
trap cleanup EXIT

echo "running e2e tests"
./tests/e2e/e2e.test \
--ginkgo.v \
Expand All @@ -167,14 +174,4 @@ echo "running e2e tests"
--grpc-gateway-endpoint="0.0.0.0:8081" \
--avalanchego-path-1=/tmp/avalanchego-v${VERSION_1}/avalanchego \
--avalanchego-path-2=/tmp/avalanchego-v${VERSION_2}/avalanchego \
--subnet-evm-path=/tmp/subnet-evm-v${SUBNET_EVM_VERSION}/subnet-evm || EXIT_CODE=$?

echo "shutting down network runner"
kill ${PID}

if [[ ${EXIT_CODE} == 0 ]]; then
echo "SUCCESS!"
else
echo "FAILURE!"
fi
exit ${EXIT_CODE}
--subnet-evm-path=/tmp/subnet-evm-v${SUBNET_EVM_VERSION}/subnet-evm

0 comments on commit e95f50e

Please sign in to comment.