Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove the dfly logo print from pytest run #4682 #4706

Merged
merged 4 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/server/dfly_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ ABSL_FLAG(uint16_t, uring_recv_buffer_cnt, 0,
"How many socket recv buffers of size 256 to allocate per thread."
"Relevant only for modern kernels with io_uring enabled");

ABSL_FLAG(bool, skip_basic_usage, false, "Skip printing basic usage info.");

using namespace util;
using namespace facade;
using namespace io;
Expand Down Expand Up @@ -740,7 +742,10 @@ Usage: dragonfly [FLAGS]

ParseFlagsFromEnv();

PrintBasicUsageInfo();
if (!GetFlag(FLAGS_skip_basic_usage)) {
PrintBasicUsageInfo();
}

LOG(INFO) << "Starting dragonfly " << GetVersion() << "-" << kGitSha;

struct sigaction act;
Expand Down
6 changes: 5 additions & 1 deletion tests/dragonfly/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ def __init__(self, params: DflyParams, args):
self.params = params
self.instances = []

def create(self, existing_port=None, path=None, version=100, **kwargs) -> DflyInstance:
def create(
self, existing_port=None, path=None, version=100, use_skip_basic_usage_flag=True, **kwargs
) -> DflyInstance:
args = {**self.args, **kwargs}
args.setdefault("dbfilename", "")
args.setdefault("noversion_check", None)
Expand All @@ -420,6 +422,8 @@ def create(self, existing_port=None, path=None, version=100, **kwargs) -> DflyIn
vmod = "dragonfly_connection=1,accept_server=1,listener_interface=1,main_service=1,rdb_save=1,replica=1,cluster_family=1,proactor_pool=1,dflycmd=1,snapshot=1,streamer=1"
args.setdefault("vmodule", vmod)
args.setdefault("jsonpathv2")
if use_skip_basic_usage_flag:
args.setdefault("skip_basic_usage")

# If path is not set, we assume that we are running the latest dragonfly.
if not path:
Expand Down
10 changes: 8 additions & 2 deletions tests/dragonfly/replication_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,7 @@ async def test_replicate_old_master(
version=1.19,
path=released_dfly_path,
cluster_mode=cluster_mode,
use_skip_basic_usage_flag=False,
)
replica = df_factory.create(
cluster_mode=cluster_mode,
Expand Down Expand Up @@ -2467,7 +2468,10 @@ async def test_empty_hash_map_replicate_old_master(df_factory):
dfly_version = "v1.21.2"
released_dfly_path = download_dragonfly_release(dfly_version)
# old versions
instances = [df_factory.create(path=released_dfly_path, version=1.21) for i in range(3)]
instances = [
df_factory.create(path=released_dfly_path, version=1.21, use_skip_basic_usage_flag=False)
for i in range(3)
]
# new version
instances.append(df_factory.create())

Expand Down Expand Up @@ -2525,7 +2529,9 @@ async def test_empty_hashmap_loading_bug(df_factory: DflyInstanceFactory):
dfly_version = "v1.21.2"
released_dfly_path = download_dragonfly_release(dfly_version)

master = df_factory.create(path=released_dfly_path, version=1.21)
master = df_factory.create(
path=released_dfly_path, version=1.21, use_skip_basic_usage_flag=False
)
master.start()

c_master = master.client()
Expand Down
Loading