Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 14, 2023
1 parent 1308b2a commit 57b31f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/function_test/bulk_load/test_bulk_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "common/bulk_load_common.h"
#include "common/json_helper.h"
#include "gtest/gtest.h"
#include "include/pegasus/client.h" // IWYU pragma: keep
#include "meta/meta_bulk_load_service.h"
#include "metadata_types.h"
#include "test/function_test/utils/global_env.h"
Expand Down
4 changes: 3 additions & 1 deletion src/test/function_test/utils/test_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test_util::test_util(map<string, string> create_envs)
: kOpNames({{test_util::OperateDataType::kSet, "set"},
{test_util::OperateDataType::kGet, "get"},
{test_util::OperateDataType::kDelete, "delete"},
{test_util::OperateDataType::kCheckNotFound, "check data not found"}}),
{test_util::OperateDataType::kCheckNotFound, "check not found"}}),
kClusterName_("onebox"),
kDefaultHashkeyPrefix("hashkey_"),
kDefaultSortkey("sortkey"),
Expand Down Expand Up @@ -188,6 +188,8 @@ void test_util::operate_data(OperateDataType type,
auto *client = pegasus_client_factory::get_client(kClusterName_.c_str(), table_name.c_str());
ASSERT_NE(client, nullptr);
int64_t start = dsn_now_ms();
ASSERT_GT(count, 0);
ASSERT_LT(count, 10000);
for (int i = 0; i < count; i++) {
auto hashkey = fmt::format("{}{:04}", hashkey_prefix, i);
std::string value;
Expand Down
4 changes: 4 additions & 0 deletions src/test/function_test/utils/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,24 @@ class test_util : public ::testing::Test

void wait_table_healthy(const std::string &table_name) const;

// Write some data to table 'table_name_' according to the parameters.
void
write_data(const std::string &hashkey_prefix, const std::string &value_prefix, int count) const;
void write_data(int count) const;

// Verify the data can be read from the table according to the parameters.
void verify_data(const std::string &table_name,
const std::string &hashkey_prefix,
const std::string &value_prefix,
int count) const;
void verify_data(int count) const;
void verify_data(const std::string &table_name, int count) const;

// Delete some data from the table according to the parameters.
void
delete_data(const std::string &table_name, const std::string &hashkey_prefix, int count) const;

// Verify the data can NOT be read from the table according to the parameters.
void check_not_found(const std::string &table_name,
const std::string &hashkey_prefix,
int count) const;
Expand Down

0 comments on commit 57b31f1

Please sign in to comment.