This is an automated email from the ASF dual-hosted git repository. granthenke pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit f8d11f22be66b3b7a241bfcdc4778eff7daa6a89 Author: triplesheep <[email protected]> AuthorDate: Wed Jul 10 11:18:22 2019 +0000 Separate benchmark to single test Separate the total benchmark to single test with paraments so they all can be run in test time limit. Change-Id: I980234bcdf76a7d2978f49ed59dff21184abf892 Reviewed-on: http://gerrit.cloudera.org:8080/13832 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <[email protected]> --- src/kudu/common/CMakeLists.txt | 2 +- src/kudu/common/wire_protocol-test.cc | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/kudu/common/CMakeLists.txt b/src/kudu/common/CMakeLists.txt index fa5c105..8121aef 100644 --- a/src/kudu/common/CMakeLists.txt +++ b/src/kudu/common/CMakeLists.txt @@ -96,4 +96,4 @@ ADD_KUDU_TEST(scan_spec-test) ADD_KUDU_TEST(schema-test) ADD_KUDU_TEST(table_util-test) ADD_KUDU_TEST(types-test) -ADD_KUDU_TEST(wire_protocol-test) +ADD_KUDU_TEST(wire_protocol-test NUM_SHARDS 4) diff --git a/src/kudu/common/wire_protocol-test.cc b/src/kudu/common/wire_protocol-test.cc index f09fa5d..d2ad3cb 100644 --- a/src/kudu/common/wire_protocol-test.cc +++ b/src/kudu/common/wire_protocol-test.cc @@ -53,13 +53,17 @@ #include "kudu/util/test_util.h" using std::string; +using std::tuple; using std::unique_ptr; using std::vector; using strings::Substitute; namespace kudu { -class WireProtocolTest : public KuduTest { +class WireProtocolTest : public KuduTest, + // Used for benchmark, int corresponds to the number of columns, + // double corresponds to the selection rate. + public testing::WithParamInterface<tuple<int, double>> { public: WireProtocolTest() : schema_({ ColumnSchema("col1", STRING), @@ -420,19 +424,15 @@ TEST_F(WireProtocolTest, TestColumnarRowBlockToPBWithPadding) { } } -#ifdef NDEBUG -TEST_F(WireProtocolTest, TestColumnarRowBlockToPBBenchmark) { - // Can set column_counts = {3, 30, 300} together with - // select_rates = {1.0, 0.8, 0.5, 0.2} for benchmark. - vector<int> column_counts = {3}; - vector<double> select_rates = {1.0}; - for (auto column_count : column_counts) { - for (auto select_rate : select_rates) { - RunBenchmark(column_count, select_rate); - } - } +TEST_P(WireProtocolTest, TestColumnarRowBlockToPBBenchmark) { + int column_count = std::get<0>(GetParam()); + double select_rate = std::get<1>(GetParam()); + RunBenchmark(column_count, select_rate); } -#endif + +INSTANTIATE_TEST_CASE_P(ColumnarRowBlockToPBBenchmarkParams, WireProtocolTest, + testing::Combine(testing::Values(3, 30, 300), + testing::Values(1.0, 0.8, 0.5, 0.2))); // Test that trying to extract rows from an invalid block correctly returns // Corruption statuses.
