Skip to content
Draft
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: 17 additions & 0 deletions hadoop-ozone/dist/src/main/compose/common/replicas-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ for dn_container in ${datanodes}; do
wait_for_datanode "${dn_container}" HEALTHY 60
done

# A datanode reporting HEALTHY only means SCM sees its heartbeat again; the
# write pipelines it belonged to are not necessarily re-established yet. Wait
# for an OPEN RATIS THREE pipeline before running the debug test, whose
# "Write keys" suite setup writes RATIS THREE and EC keys and otherwise fails
# with a non-zero exit when no pipeline is available after the restart above.
echo "Waiting for an OPEN RATIS THREE pipeline before writing keys"
SECONDS=0
until [[ "$(docker-compose exec -T ${SCM} bash -c \
"ozone admin pipeline list --state OPEN --type RATIS --replication THREE --json" 2>/dev/null \
| jq -r 'length')" -ge 1 ]]; do
if [[ $SECONDS -ge 180 ]]; then
echo "Timed out waiting for an OPEN RATIS THREE pipeline" >&2
exit 1
fi
sleep 2
done
Comment on lines +74 to +84

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a function in testlib.sh for single check for pipeline (e.g. pipeline_exists), and use retry to repeat it.

RETRY_ATTEMPTS=60 retry pipeline_exists RATIS THREE


execute_robot_test ${SCM} -v "PREFIX:${prefix}" debug/ozone-debug-tests.robot

# get block locations for key
Expand Down