Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Sep 18, 2020
1 parent 42e1272 commit 25d39ce
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ci/live-cluster-sanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ source ci/upload-ci-artifact.sh

escaped_branch=$(echo "$BUILDKITE_BRANCH" | tr -c "[:alnum:]" - | sed -r "s#(^-*|-*head-*|-*$)##g")
instance_prefix="testnet-live-sanity-$escaped_branch"
# ensure to delete leftover cluster
./net/gce.sh delete -p "$instance_prefix" || true
# only bootstrap, no normal validator
./net/gce.sh create -p "$instance_prefix" -n 0
instance_ip=$(./net/gce.sh info | grep bootstrap-validator | awk '{print $3}')

on_trap() {
if [[ -z $instance_deleted ]]; then
(
set +e
upload-ci-artifact \
cluster-sanity/mainnet-beta-validator.log \
cluster-sanity/testnet-validator.log
upload-ci-artifact cluster-sanity/testnet-validator.log
upload-ci-artifact cluster-sanity/mainnet-beta-validator.log
_ ./net/gce.sh delete -p "$instance_prefix"
)
fi
Expand Down Expand Up @@ -68,11 +70,12 @@ test_with_live_cluster() {
fi

sleep 3
echo "### validator is starting... (until timeout: $attempts) ###"
echo "##### validator is starting... (until timeout: $attempts) #####"
if find cluster-sanity/log-tail -not -empty | grep ^ > /dev/null; then
echo "### new log:"
echo "##### new log:"
timeout 1 cat cluster-sanity/log-tail | tail -n 3 || true
truncate --size 0 cluster-sanity/log-tail
echo
fi
done

Expand All @@ -99,11 +102,12 @@ test_with_live_cluster() {

sleep 3
current_root=$(./target/release/solana --url http://localhost:18899 slot --commitment root)
echo "### validator is running ($current_root/$goal_root)... (until timeout: $attempts) ###"
echo "##### validator is running ($current_root/$goal_root)... (until timeout: $attempts) #####"
if find cluster-sanity/log-tail -not -empty | grep ^ > /dev/null; then
echo "### new log:"
echo "##### new log:"
timeout 1 cat cluster-sanity/log-tail | tail -n 3 || true
truncate --size 0 cluster-sanity/log-tail
echo
fi
done

Expand Down

0 comments on commit 25d39ce

Please sign in to comment.