Skip to content

Commit

Permalink
Merge branch 'main' into InlineScheduleSingle
Browse files Browse the repository at this point in the history
  • Loading branch information
romange authored Mar 6, 2023
2 parents 2d923ed + 7cb2232 commit 15b4665
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Regression Tests



on:
schedule:
- cron: '0 0/3 * * *'
Expand All @@ -16,7 +14,7 @@ jobs:
# Test of these containers
container: ["ubuntu-dev:20"]
build-type: [Debug, Release]
timeout-minutes: 30
timeout-minutes: 45

container:
image: ghcr.io/romange/${{ matrix.container }}
Expand All @@ -25,8 +23,8 @@ jobs:
with:
submodules: true

name: Print cpu info
cat /proc/cpuinfo
- name: Print cpu info
run: cat /proc/cpuinfo

- name: Configure & Build
run: |
Expand Down
1 change: 1 addition & 0 deletions tests/dragonfly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def stop(self, kill=False):
except subprocess.TimeoutExpired:
print("Unable to terminate DragonflyDB gracefully, it was killed")
proc.kill()
proc.communicate()

def _start(self):
base_args = [f"--{v}" for v in self.params.args]
Expand Down
1 change: 1 addition & 0 deletions tests/dragonfly/replication_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ async def crash_master_fs():
master.stop(kill=True)

async def start_master():
await asyncio.sleep(0.2)
master.start()
c_master = aioredis.Redis(port=master.port)
assert await c_master.ping()
Expand Down
25 changes: 14 additions & 11 deletions tests/dragonfly/sentinel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import pytest
import time
import asyncio
from datetime import datetime
from sys import stderr
import logging


# Helper function to parse some sentinel cli commands output as key value dictionaries.
Expand Down Expand Up @@ -61,7 +64,7 @@ def start(self):
]
self.config_file.write_text("\n".join(config))

print(self.config_file.read_text())
logging.info(self.config_file.read_text())

self.proc = subprocess.Popen(["redis-server", f"{self.config_file.absolute()}", "--sentinel"])

Expand Down Expand Up @@ -127,7 +130,7 @@ async def test_failover(df_local_factory, sentinel):

master_client = aioredis.Redis(port=master.port)
replica_client = aioredis.Redis(port=replica.port)
print("master: " + str(master.port) + " replica: " + str(replica.port), flush=True)
logging.info("master: " + str(master.port) + " replica: " + str(replica.port))

await replica_client.execute_command("REPLICAOF localhost " + str(master.port))

Expand Down Expand Up @@ -161,15 +164,15 @@ async def test_failover(df_local_factory, sentinel):
syncid, r_offset = await master_client.execute_command("DEBUG REPLICA OFFSET")
replicaoffset_cmd = "DFLY REPLICAOFFSET " + syncid.decode()
m_offset = await replica_client.execute_command(replicaoffset_cmd)
print(syncid.decode(), r_offset, m_offset)
print("replica client role:")
print(await replica_client.execute_command("role"))
print("master client role:")
print(await master_client.execute_command("role"))
print("replica client info:")
print(await replica_client.info())
print("master client info:")
print(await master_client.info())
logging.info(f"{syncid.decode()} {r_offset} {m_offset}")
logging.info("replica client role:")
logging.info(await replica_client.execute_command("role"))
logging.info("master client role:")
logging.info(await master_client.execute_command("role"))
logging.info("replica client info:")
logging.info(await replica_client.info())
logging.info("master client info:")
logging.info(await master_client.info())
raise


Expand Down
6 changes: 6 additions & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
log_format = [%(asctime)s.%(msecs)03d %(levelname)s] %(message)s
log_cli_format = [%(asctime)s.%(msecs)03d %(levelname)s] %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
log_file_level=DEBUG
log_cli = true

0 comments on commit 15b4665

Please sign in to comment.