Skip to content

Commit

Permalink
fix recover test
Browse files Browse the repository at this point in the history
  • Loading branch information
GehaFearless committed Sep 27, 2023
1 parent 3951592 commit bfd39ff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ function run_test()
restore_test
throttle_test
)
if [[ "${need_onebox_tests[@]}" =~ "${test_modules}" ]]; then
if [[ "${need_onebox_tests[@]}" =~ "${module}" ]]; then
run_clear_onebox
m_count=3
if [ "${test_modules}" == "recovery_test" ]; then
Expand Down
5 changes: 4 additions & 1 deletion src/test/function_test/recovery_test/test_recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ class recovery_test : public test_util
}

public:
recovery_test(): test_util(std::map<std::string, std::string>(), "single_master_cluster") {}

std::vector<dsn::host_port> get_rpc_host_port_list(const std::vector<int> ports)
{
std::vector<dsn::host_port> result;
result.reserve(ports.size());
for (const int &p : ports) {
dsn::host_port hp(global_env::instance()._host_ip.c_str(), p);
dsn::rpc_address addr(global_env::instance()._host_ip.c_str(), p);
dsn::host_port hp(addr);
result.push_back(hp);
}
return result;
Expand Down
5 changes: 3 additions & 2 deletions src/test/function_test/utils/test_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "utils/error_code.h"
#include "utils/filesystem.h"
#include "utils/rand.h"
#include "utils/fmt_logging.h"

using dsn::partition_configuration;
using dsn::replication::replica_helper;
Expand All @@ -56,8 +57,8 @@ using std::vector;

namespace pegasus {

test_util::test_util(map<string, string> create_envs)
: cluster_name_("mycluster"), app_name_("temp"), create_envs_(std::move(create_envs))
test_util::test_util(map<string, string> create_envs, string cluster_name)
: cluster_name_(cluster_name), app_name_("temp"), create_envs_(std::move(create_envs))
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/function_test/utils/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class pegasus_client;
class test_util : public ::testing::Test
{
public:
test_util(std::map<std::string, std::string> create_envs = {});
test_util(std::map<std::string, std::string> create_envs = {}, std::string cluster_name = "mycluster");
virtual ~test_util();

static void SetUpTestCase();
Expand Down

0 comments on commit bfd39ff

Please sign in to comment.