From 38f49de6d96239793f5207fc26f0826f6f8c1707 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Wed, 29 May 2024 15:28:55 +0200 Subject: [PATCH 1/3] fix(deb): fix apt purge when emqx service was still running --- deploy/packages/deb/debian/postrm | 5 +++-- scripts/pkg-tests.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/deploy/packages/deb/debian/postrm b/deploy/packages/deb/debian/postrm index 5df55135a..9ee1dca87 100755 --- a/deploy/packages/deb/debian/postrm +++ b/deploy/packages/deb/debian/postrm @@ -21,6 +21,8 @@ set -e case "$1" in purge) + # force kill all processes owned by emqx, if any + pkill -9 -u emqx || true rm -f /etc/default/emqx if [ -d /var/lib/emqx ]; then @@ -38,9 +40,8 @@ case "$1" in if [ -e /etc/init.d/emqx ]; then rm /etc/init.d/emqx fi - # Remove User & Group, killing any process owned by them + # Remove User & Group if getent passwd emqx >/dev/null; then - pkill -u emqx || true deluser --quiet --system emqx fi if getent group emqx >/dev/null; then diff --git a/scripts/pkg-tests.sh b/scripts/pkg-tests.sh index a88020dd5..dfb5d098f 100755 --- a/scripts/pkg-tests.sh +++ b/scripts/pkg-tests.sh @@ -131,6 +131,21 @@ emqx_test(){ exit 1 fi + echo "try to install again and purge while the service is running" + dpkg -i "${PACKAGE_PATH}/${packagename}" + if [ "$(dpkg -l | grep ${EMQX_NAME} | awk '{print $1}')" != "ii" ] + then + echo "package install error" + exit 1 + fi + if ! /usr/bin/emqx start + then + echo "ERROR: failed_to_start_emqx" + cat /var/log/emqx/erlang.log.1 || true + cat /var/log/emqx/emqx.log.1 || true + exit 1 + fi + /usr/bin/emqx ping dpkg -P "${EMQX_NAME}" if dpkg -l |grep -q emqx then From 830926044c32ff6b1adfbd0a3b182232700b61e1 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 30 May 2024 17:02:03 +0200 Subject: [PATCH 2/3] chore: bump erlang-rocksdb to 1.8.0-emqx-5 - fix macos build https://github.com/google/snappy/issues/183 - pre-built binaries for latest platforms --- mix.exs | 2 +- rebar.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index f3e91096e..7b17931fb 100644 --- a/mix.exs +++ b/mix.exs @@ -54,7 +54,7 @@ defmodule EMQXUmbrella.MixProject do {:jiffy, github: "emqx/jiffy", tag: "1.0.6", override: true}, {:cowboy, github: "emqx/cowboy", tag: "2.9.2", override: true}, {:esockd, github: "emqx/esockd", tag: "5.11.2", override: true}, - {:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-2", override: true}, + {:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-5", override: true}, {:ekka, github: "emqx/ekka", tag: "0.19.3", override: true}, {:gen_rpc, github: "emqx/gen_rpc", tag: "3.3.1", override: true}, {:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true}, diff --git a/rebar.config b/rebar.config index 98f8e2177..b260b366e 100644 --- a/rebar.config +++ b/rebar.config @@ -82,7 +82,7 @@ {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.6"}}}, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}}, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.11.2"}}}, - {rocksdb, {git, "https://github.com/emqx/erlang-rocksdb", {tag, "1.8.0-emqx-2"}}}, + {rocksdb, {git, "https://github.com/emqx/erlang-rocksdb", {tag, "1.8.0-emqx-5"}}}, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.19.3"}}}, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.1"}}}, {grpc, {git, "https://github.com/emqx/grpc-erl", {tag, "0.6.12"}}}, From 2d5d96ae331b896ab4aae4418f2583ead3f5e547 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 30 May 2024 18:27:29 +0200 Subject: [PATCH 3/3] ci(ui-tests): retry getting element by xpath --- scripts/ui-tests/dashboard_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/ui-tests/dashboard_test.py b/scripts/ui-tests/dashboard_test.py index 602d944fd..85d40cec8 100644 --- a/scripts/ui-tests/dashboard_test.py +++ b/scripts/ui-tests/dashboard_test.py @@ -100,7 +100,15 @@ def test_docs_link(driver, login, dashboard_url): driver.get(dest_url) ensure_current_url(driver, dest_url) xpath_link_help = "//div[@id='app']//div[@class='nav-header']//a[contains(@class, 'link-help')]" - link_help = driver.find_element(By.XPATH, xpath_link_help) + # retry up to 5 times + for _ in range(5): + try: + link_help = driver.find_element(By.XPATH, xpath_link_help) + break + except NoSuchElementException: + time.sleep(1) + else: + raise AssertionError("Cannot find the help link") driver.execute_script("arguments[0].click();", link_help) prefix, emqx_version = fetch_version(dashboard_url)