From 120fadc0f63a3c59bec15b55c9be69599dae0ef0 Mon Sep 17 00:00:00 2001 From: "suxiaobin.sxb" Date: Mon, 25 Dec 2023 10:06:55 +0800 Subject: [PATCH] bugfix: Fix CI bugs --- tests/cases/aof.py | 2 +- tests/helpers/shake.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cases/aof.py b/tests/cases/aof.py index c18d545c..2eaef482 100644 --- a/tests/cases/aof.py +++ b/tests/cases/aof.py @@ -19,7 +19,7 @@ def create_aof_dir(dir_path): os.makedirs(dir_path, exist_ok=True) def get_aof_file_relative_path(): - if h.REDIS_SERVER_VERSION == 7.0: + if h.REDIS_SERVER_VERSION >= 7.0: aof_file = "/appendonlydir/appendonly.aof.manifest" else: aof_file = "/appendonly.aof" diff --git a/tests/helpers/shake.py b/tests/helpers/shake.py index 7664b3f2..652dc68b 100644 --- a/tests/helpers/shake.py +++ b/tests/helpers/shake.py @@ -3,7 +3,6 @@ import pybbt import requests import toml - from helpers.constant import PATH_REDIS_SHAKE from helpers.redis import Redis from helpers.utils.filesystem import create_empty_dir @@ -50,7 +49,7 @@ def create_rdb_opts(rdb_path: str, dts: Redis) -> typing.Dict: } } return d - + @staticmethod def create_aof_opts(aof_path: str, dts: Redis, timestamp: int = 0) -> typing.Dict: d = { @@ -62,6 +61,7 @@ def create_aof_opts(aof_path: str, dts: Redis, timestamp: int = 0) -> typing.Dic } return d + class Shake: def __init__(self, opts: typing.Dict): self.case_ctx = pybbt.get_case_context() @@ -97,7 +97,7 @@ def _wait_start(self, timeout=5): try: self.get_status() return - except requests.exceptions.ConnectionError: + except (requests.exceptions.ConnectionError, requests.exceptions.JSONDecodeError): pass if timer.elapsed() > timeout: raise Exception(f"Shake server not started in {timeout} seconds")