Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add debug output to e2e_basic_start_stop #4396

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions test/scripts/e2e_basic_start_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function verify_at_least_one_running() {
}

function verify_none_running() {
local datadir=$1

# Shutting down can take some time, so wait at least 5 seconds
for TRIES in 1 2 3 4 5; do
update_running_count
Expand All @@ -37,6 +39,15 @@ function verify_none_running() {
sleep 1.4
done
echo "algod not expected to be running but it is"
if [ -n "$datadir" ]; then
echo "last 20 lines of node.log:"
tail -20 "$datadir/node.log"
echo "================================"
echo "stdout and stdin:"
cat "$datadir/algod-out.log"
echo "================================"
cat "$datadir/algod-err.log"
fi
exit 1
}

Expand Down Expand Up @@ -64,15 +75,15 @@ verify_at_least_one_running

echo Verifying we can stop it using goal
goal node stop -d ${DATADIR}
verify_none_running
verify_none_running ${DATADIR}

#----------------------
# Test that we can start a generic node straight with no overrides
echo Verifying a generic node will start directly
algod -d ${DATADIR} &
verify_at_least_one_running
pkill -u $(whoami) -x algod || true
verify_none_running
verify_none_running ${DATADIR}

#----------------------
# Test that we can start a generic node against the datadir
Expand All @@ -85,7 +96,7 @@ verify_at_least_one_running # one should still be running
verify_one_running # in fact, exactly one should still be running
# clean up
pkill -u $(whoami) -x algod || true
verify_none_running
verify_none_running ${DATADIR}

echo "----------------------------------------------------------------------"
echo " DONE: e2e_basic_start_stop"
Expand Down