Skip to content

Commit 5a50939

Browse files
committed
Makefile tweaks
Sleep after launching redis instances to allow replication to complete Add 2nd slave instance Remove test_sentinel section - references missing tests
1 parent 6820ea8 commit 5a50939

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ REDIS_LOG = /redis.log
1414
REDIS_PREFIX = /tmp/redis-
1515

1616
# Overrideable redis test variables
17-
TEST_REDIS_PORTS ?= 6379 6380
17+
TEST_REDIS_PORTS ?= 6379 6380 6378
1818
TEST_REDIS_DATABASE ?= 1
1919

2020
REDIS_FIRST_PORT := $(firstword $(TEST_REDIS_PORTS))
@@ -65,7 +65,7 @@ INSTALL ?= install
6565
.PHONY: all install test test_all start_redis_instances stop_redis_instances \
6666
start_redis_instance stop_redis_instance cleanup_redis_instance flush_db \
6767
create_sentinel_config delete_sentinel_config check_ports test_redis \
68-
test_sentinel
68+
test_sentinel sleep
6969

7070
all: ;
7171

@@ -74,7 +74,10 @@ install: all
7474
$(INSTALL) lib/resty/redis/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/resty/redis
7575

7676
test: test_redis
77-
test_all: start_redis_instances test_redis test_sentinel stop_redis_instances
77+
test_all: start_redis_instances sleep test_redis stop_redis_instances
78+
79+
sleep:
80+
sleep 3
7881

7982
start_redis_instances: check_ports create_sentinel_config
8083
@$(foreach port,$(TEST_REDIS_PORTS), \
@@ -91,6 +94,7 @@ start_redis_instances: check_ports create_sentinel_config
9194
prefix=$(REDIS_PREFIX)$(port) && \
9295
) true
9396

97+
9498
stop_redis_instances: delete_sentinel_config
9599
-@$(foreach port,$(TEST_REDIS_PORTS) $(TEST_SENTINEL_PORTS), \
96100
$(MAKE) stop_redis_instance cleanup_redis_instance port=$(port) \
@@ -140,12 +144,5 @@ test_redis: flush_db
140144
$(TEST_REDIS_VARS) $(PROVE) $(TEST_FILE)
141145
util/lua-releng
142146

143-
test_sentinel: flush_db
144-
$(TEST_SENTINEL_VARS) $(PROVE) $(SENTINEL_TEST_FILE)/01-master_up.t
145-
$(REDIS_CLI) shutdown
146-
$(TEST_SENTINEL_VARS) $(PROVE) $(SENTINEL_TEST_FILE)/02-master_down.t
147-
sleep $(TEST_SENTINEL_PROMOTION_TIME)
148-
$(TEST_SENTINEL_VARS) $(PROVE) $(SENTINEL_TEST_FILE)/03-slave_promoted.t
149-
150147
test_leak: flush_db
151148
$(TEST_REDIS_VARS) TEST_NGINX_CHECK_LEAK=1 $(PROVE) $(TEST_FILE)

0 commit comments

Comments
 (0)