From a703c42db960deade4a75bd8f90444511a1e44f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 11 Nov 2024 16:47:41 +0100 Subject: [PATCH 1/2] rabbitmq_cli: Use `make start-background-broker` to start test node [Why] The `run-background-broker` does not wait for the node to be ready, leading to some transient errors in the testsuite. [How] The `start-background-broker` does wait. While here, export the value of `$(MAKE)`. Otherwise, nested uses of make(1) may use the wrong make command. (cherry picked from commit e480513297f35da90afece413f311f03512146d2) --- deps/rabbitmq_cli/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/rabbitmq_cli/Makefile b/deps/rabbitmq_cli/Makefile index 7c8c9f910a96..386229bbc4cf 100644 --- a/deps/rabbitmq_cli/Makefile +++ b/deps/rabbitmq_cli/Makefile @@ -27,6 +27,8 @@ ifeq ($(VERBOSE_TEST),true) MIX_TEST := $(MIX_TEST) --trace endif +export MAKE + include ../../rabbitmq-components.mk include ../../erlang.mk @@ -114,7 +116,7 @@ rel:: $(ESCRIPTS) tests:: $(ESCRIPTS) $(verbose) $(MAKE) -C ../../ install-cli - $(verbose) $(MAKE) -C ../../ run-background-broker PLUGINS="rabbit rabbitmq_federation rabbitmq_stomp rabbitmq_stream_management amqp_client" + $(verbose) $(MAKE) -C ../../ start-background-broker PLUGINS="rabbit rabbitmq_federation rabbitmq_stomp rabbitmq_stream_management amqp_client" $(gen_verbose) $(MIX_TEST) $(TEST_FILE); \ RES=$$?; \ $(MAKE) -C ../../ stop-node; \ From 1f74193ea4c640345aea446514d7871dd40485b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Tue, 12 Nov 2024 16:43:13 +0100 Subject: [PATCH 2/2] rabbitmq_cli: Honor $RABBITMQ_METADATA_STORE when starting test node [Why] Two reasons: 1. ~~We need to set the correct feature flags on the test node we have to start.~~ In 4.0.x, we don't set `$RABBITMQ_FEATURE_FLAGS` because it has no support for +/-feature_flag. 2. We can skip Mnesia- or Khepri-specific tests if they are marked. (cherry picked from commit 041186467039ff90ef63b164a617f1fde46f331a) --- deps/rabbitmq_cli/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deps/rabbitmq_cli/Makefile b/deps/rabbitmq_cli/Makefile index 386229bbc4cf..c02761053edf 100644 --- a/deps/rabbitmq_cli/Makefile +++ b/deps/rabbitmq_cli/Makefile @@ -116,8 +116,11 @@ rel:: $(ESCRIPTS) tests:: $(ESCRIPTS) $(verbose) $(MAKE) -C ../../ install-cli - $(verbose) $(MAKE) -C ../../ start-background-broker PLUGINS="rabbit rabbitmq_federation rabbitmq_stomp rabbitmq_stream_management amqp_client" - $(gen_verbose) $(MIX_TEST) $(TEST_FILE); \ + $(verbose) $(MAKE) -C ../../ start-background-broker \ + PLUGINS="rabbit rabbitmq_federation rabbitmq_stomp rabbitmq_stream_management amqp_client" + $(gen_verbose) $(MIX_TEST) \ + $(if $(RABBITMQ_METADATA_STORE),--exclude $(filter-out $(RABBITMQ_METADATA_STORE),khepri mnesia),) \ + $(TEST_FILE); \ RES=$$?; \ $(MAKE) -C ../../ stop-node; \ exit $$RES