Skip to content

Commit

Permalink
Added multi-key command test
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 committed May 4, 2022
1 parent d74d161 commit 6ef066a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ run_tests() {
OSS_STANDALONE=${OSS_STANDALONE:-1}
OSS_CLUSTER=${OSS_CLUSTER:-0}
SHARDS=${SHARDS:-3}
TEST=${TEST:-""}

TLS_KEY=$ROOT/tests/tls/redis.key
TLS_CERT=$ROOT/tests/tls/redis.crt
Expand All @@ -70,6 +71,7 @@ REDIS_SERVER=${REDIS_SERVER:-redis-server}
MEMTIER_BINARY=$ROOT/memtier_benchmark

RLTEST_ARGS=" --oss-redis-path $REDIS_SERVER"
[[ "$TEST" != "" ]] && RLTEST_ARGS+=" --test $TEST"
[[ $VERBOSE == 1 ]] && RLTEST_ARGS+=" -v"
[[ $TLS == 1 ]] && RLTEST_ARGS+=" --tls-cert-file $TLS_CERT --tls-key-file $TLS_KEY --tls-ca-cert-file $TLS_CACERT --tls"

Expand Down
29 changes: 29 additions & 0 deletions tests/tests_oss_simple_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,32 @@ def test_default_arbitrary_command_hset_multi_placeholders(env):
overall_request_count = agg_info_commandstats(master_nodes_connections, merged_command_stats)
assert_minimum_memtier_outcomes(config, env, memtier_ok, merged_command_stats, overall_expected_request_count,
overall_request_count)

def test_arbitrary_command_mset_multi_key_placeholders(env):
# skip on cluster given we can't control cross slot from happening
env.skipOnCluster()
benchmark_specs = {"name": env.testName, "args": ['--command=MSET __key__ __data__ __key__ __data__']}
addTLSArgs(benchmark_specs, env)
config = get_default_memtier_config()
master_nodes_list = env.getMasterNodesList()
overall_expected_request_count = get_expected_request_count(config)

add_required_env_arguments(benchmark_specs, config, env, master_nodes_list)

# Create a temporary directory
test_dir = tempfile.mkdtemp()

config = RunConfig(test_dir, env.testName, config, {})
ensure_clean_benchmark_folder(config.results_dir)

benchmark = Benchmark.from_json(config, benchmark_specs)

# benchmark.run() returns True if the return code of memtier_benchmark was 0
memtier_ok = benchmark.run()
debugPrintMemtierOnError(config, env, memtier_ok)

master_nodes_connections = env.getOSSMasterNodesConnectionList()
merged_command_stats = {'cmdstat_mset': {'calls': 0}}
overall_request_count = agg_info_commandstats(master_nodes_connections, merged_command_stats)
assert_minimum_memtier_outcomes(config, env, memtier_ok, merged_command_stats, overall_expected_request_count,
overall_request_count)

0 comments on commit 6ef066a

Please sign in to comment.