diff --git a/src/test/function_test/bulk_load/test_bulk_load.cpp b/src/test/function_test/bulk_load/test_bulk_load.cpp index 3e1c7b3f47..ad791cf72e 100644 --- a/src/test/function_test/bulk_load/test_bulk_load.cpp +++ b/src/test/function_test/bulk_load/test_bulk_load.cpp @@ -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" diff --git a/src/test/function_test/utils/test_util.cpp b/src/test/function_test/utils/test_util.cpp index 857d7148a8..a395b4b3c2 100644 --- a/src/test/function_test/utils/test_util.cpp +++ b/src/test/function_test/utils/test_util.cpp @@ -66,7 +66,7 @@ test_util::test_util(map 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"), @@ -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; diff --git a/src/test/function_test/utils/test_util.h b/src/test/function_test/utils/test_util.h index 885775f790..a2444b4dfc 100644 --- a/src/test/function_test/utils/test_util.h +++ b/src/test/function_test/utils/test_util.h @@ -66,10 +66,12 @@ 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, @@ -77,9 +79,11 @@ class test_util : public ::testing::Test 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;