diff --git a/tests/modules/moduleparameter.c b/tests/modules/moduleparameter.c index 0bd5ce3556..a60753c659 100644 --- a/tests/modules/moduleparameter.c +++ b/tests/modules/moduleparameter.c @@ -8,11 +8,7 @@ int GET_HELLO(ValkeyModuleCtx *ctx, ValkeyModuleString **argv, int argc) { VALKEYMODULE_NOT_USED(argv); VALKEYMODULE_NOT_USED(argc); - ValkeyModuleRunTimeArgs *ret = ValkeyModule_GetRunTimeArgs(ctx); - ValkeyModule_Log(ctx, "warning", "dbsize command arg number is %d", - ret->argc); - ValkeyModule_Log(ctx, "warning", "dbsize command arg 0 is %s", - ret->argv[0]); + ValkeyModule_UpdateRunTimeArgs(ctx, 0, "99"); return ValkeyModule_ReplyWithSimpleString(ctx, "Module runtime args test"); } diff --git a/tests/unit/moduleapi/moduleconfigs.tcl b/tests/unit/moduleapi/moduleconfigs.tcl index 6098f91c5f..7ffe2c0677 100644 --- a/tests/unit/moduleapi/moduleconfigs.tcl +++ b/tests/unit/moduleapi/moduleconfigs.tcl @@ -246,6 +246,17 @@ start_server {tags {"modules"}} { } } + test {Module Update Args } { + r module load $testmoduleparameter 10 20 30 + + set t [r module list] + set modulename [lmap x [r module list] {dict get $x name}] + assert_not_equal [lsearch $modulename myhello] -1 + string match "10 20 30" [lmap x [r module list] {dict get $x args}] + r hello.hi + string match "99 20 30" [lmap x [r module list] {dict get $x args}] + } + }