From b4db54327340ebc201e63a7f2ef609c6c1829973 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Sat, 7 Jan 2023 22:27:29 +0800 Subject: [PATCH] Ensure no etcd server is running before acceptance tests Otherwise acceptance tests can't spin up new etcd server which use same port. Closes: #1027707 --- debian/tests/acceptance | 7 +++++++ debian/tests/control | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/tests/acceptance b/debian/tests/acceptance index b569587..3810784 100755 --- a/debian/tests/acceptance +++ b/debian/tests/acceptance @@ -44,6 +44,13 @@ case $DEB_HOST_ARCH in ;; esac +# ensure no etcd server is running. +if [ $(id -u) -eq 0 ] +then + service etcd stop + service etcd status || true +fi + set -x for PG_VERSION in $(ls -1r /usr/lib/postgresql/); do echo "### PostgreSQL $PG_VERSION acceptance-$DCS $@ ###" diff --git a/debian/tests/control b/debian/tests/control index 012400d..0f038eb 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -22,7 +22,7 @@ Depends: python3-etcd (>= 0.4.3), @, Test-Command: debian/tests/acceptance etcd features/basic_replication.feature -Restrictions: allow-stderr +Restrictions: needs-root, allow-stderr Features: test-name=acceptance-etcd Depends: @@ -34,7 +34,7 @@ Depends: python3-etcd (>= 0.4.3), @, Test-Command: debian/tests/acceptance etcd -Restrictions: allow-stderr, flaky +Restrictions: needs-root, allow-stderr, flaky # consul Features: test-name=acceptance-consul