Skip to content

Commit

Permalink
Merge pull request #1115 from supercaracal/fix-test-settings-for-sent…
Browse files Browse the repository at this point in the history
…inel

Prevent to continue to wait for sentinels which not to recognize broken replications
  • Loading branch information
byroot committed Aug 10, 2022
2 parents 1c7cd38 + 5648b67 commit ad7a0f9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
7 changes: 7 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,21 @@ start_sentinel: ${BINARY}
--sentinel;\
done

wait_for_sentinel: MAX_ATTEMPTS_FOR_WAIT ?= 60
wait_for_sentinel:
@for port in ${SENTINEL_PORTS}; do\
i=0;\
while : ; do\
if [ $${i} -ge ${MAX_ATTEMPTS_FOR_WAIT} ]; then\
echo "Max attempts exceeded: $${i} times";\
exit 1;\
fi;\
if [ $$(${REDIS_CLIENT} -p $${port} SENTINEL SLAVES ${HA_GROUP_NAME} | wc -l) -gt 1 ]; then\
break;\
fi;\
echo 'Waiting for Redis sentinel to be ready...';\
sleep 1;\
i=$$(( $${i}+1 ));\
done;\
done

Expand Down
1 change: 0 additions & 1 deletion test/support/conf/redis-5.0.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
slaveof no one
appendonly no
save ""
1 change: 0 additions & 1 deletion test/support/conf/redis-6.0.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
slaveof no one
appendonly no
save ""
1 change: 0 additions & 1 deletion test/support/conf/redis-6.2.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
slaveof no one
appendonly no
save ""
1 change: 0 additions & 1 deletion test/support/conf/redis-7.0.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
slaveof no one
appendonly no
save ""
enable-debug-command yes

0 comments on commit ad7a0f9

Please sign in to comment.