Skip to content

Commit 067d7ce

Browse files
committed
[skip ci] Optional delay in make restart-cluster
`make restart-cluster` allows simple rolling restart/upgrade testing. `make restart-cluster RESTART_DELAY=N` adds an option to force a delay from when a node goes down, till it start up again. This is useful in some tests scenarios, such as: 1. forcing the cluster to work longer in a mixed-version configuration 2. forcing the stopped member to fall behind in terms of replication to trigger a more demanding catch-up
1 parent d048227 commit 067d7ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/rabbit_common/mk/rabbitmq-run.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ RABBITMQCTL ?= $(RABBITMQ_SCRIPTS_DIR)/rabbitmqctl
3333
RABBITMQ_UPGRADE ?= $(RABBITMQ_SCRIPTS_DIR)/rabbitmq-upgrade
3434
endif
3535

36+
RESTART_DELAY ?= 0
37+
3638
export RABBITMQ_SCRIPTS_DIR RABBITMQCTL RABBITMQ_PLUGINS RABBITMQ_SERVER RABBITMQ_UPGRADE
3739

3840
# We export MAKE to be sure scripts and tests use the proper command.
@@ -415,6 +417,8 @@ restart-cluster:
415417
$(RABBITMQ_UPGRADE) -n "$$nodename" drain; \
416418
$(MAKE) stop-node \
417419
RABBITMQ_NODENAME="$$nodename"; \
420+
echo "Sleeping for $(RESTART_DELAY) seconds..."; \
421+
sleep $(RESTART_DELAY); \
418422
$(MAKE) start-background-broker \
419423
NOBUILD=1 \
420424
RABBITMQ_NODENAME="$$nodename" \

0 commit comments

Comments
 (0)