From a115bc2b9fe86aabbcbb5677b7a908127b487573 Mon Sep 17 00:00:00 2001 From: Shahar Mike Date: Wed, 18 Sep 2024 09:40:26 +0300 Subject: [PATCH] fix: Fix test `test_client_pause_with_replica` (#3729) There are 2 minor issues with this test: 1. It specified `cmdstat_replconf` as `cmd_stats` instead of `cmd`, that's clearly a typo as `cmd_stats` is a map with stats, while `replconf` is a Dragonfly command 2. Command `MULTI` is allowed to run even when the server is in paused state, see [here](https://github.com/dragonflydb/dragonfly/blob/main/src/server/main_service.cc#L1197): ``` // Don't interrupt running multi commands or admin connections. ``` Fixes #3675 --- tests/dragonfly/replication_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/dragonfly/replication_test.py b/tests/dragonfly/replication_test.py index 9d74e53dc..6e8dc0d6c 100644 --- a/tests/dragonfly/replication_test.py +++ b/tests/dragonfly/replication_test.py @@ -1987,8 +1987,9 @@ async def test_client_pause_with_replica(df_factory, df_seeder_factory): stats_after_sleep = await c_master.info("CommandStats") # Check no commands are executed except info and replconf called from replica for cmd, cmd_stats in stats_after_sleep.items(): - if "cmdstat_info" != cmd and "cmdstat_replconf" != cmd_stats: - assert stats[cmd] == cmd_stats, cmd + if cmd in ["cmdstat_info", "cmdstat_replconf", "cmdstat_multi"]: + continue + assert stats[cmd] == cmd_stats, cmd await asyncio.sleep(6) seeder.stop()