This is an automated email from the ASF dual-hosted git repository. adar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push: new 49a7fee [test] Make the kudu-admin-test more robust by adding AssertEventually 49a7fee is described below commit 49a7fee6c545e11b5e08fac6fea69c868e1d6b54 Author: honeyhexin <honeyhe...@sohu.com> AuthorDate: Thu Aug 15 21:26:11 2019 +0800 [test] Make the kudu-admin-test more robust by adding AssertEventually Sometimes it's possible the scan will not immediately retrieve the row even though the write has already succeeded, therefore add AssertEventually to assure the scan return the right result. It will make the test case more robust. Change-Id: Ied2993acaf35eef9d177f7e3cd1cd62ea9a1cdfb Reviewed-on: http://gerrit.cloudera.org:8080/14070 Tested-by: Kudu Jenkins Reviewed-by: Adar Dembo <a...@cloudera.com> --- src/kudu/tools/kudu-admin-test.cc | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/kudu/tools/kudu-admin-test.cc b/src/kudu/tools/kudu-admin-test.cc index b19b0aa..6550202 100644 --- a/src/kudu/tools/kudu-admin-test.cc +++ b/src/kudu/tools/kudu-admin-test.cc @@ -2409,8 +2409,10 @@ TEST_F(AdminCliTest, TestAddAndDropUnboundedPartition) { "[]", }, &stdout, &stderr); ASSERT_TRUE(s.ok()) << ToolRunInfo(s, stdout, stderr); - ASSERT_OK(client_->OpenTable(kTableId, &table)); - ASSERT_EQ(0, CountTableRows(table.get())); + ASSERT_EVENTUALLY([&]() { + ASSERT_OK(client_->OpenTable(kTableId, &table)); + ASSERT_EQ(0, CountTableRows(table.get())); + }); // Since the unbounded partition has been dropped, now we can add a new unbounded // range parititon for the table. @@ -2525,6 +2527,7 @@ TEST_F(AdminCliTest, TestAddAndDropRangePartition) { // Insert num_rows_to_insert rows to table. ASSERT_OK(InsertTestRows(client_, kTestTableName, start_row_to_insert, num_rows_to_insert)); + ASSERT_OK(client_->OpenTable(kTestTableName, &table)); ASSERT_EQ(num_rows_to_insert, CountTableRows(table.get())); @@ -2538,10 +2541,12 @@ TEST_F(AdminCliTest, TestAddAndDropRangePartition) { ASSERT_OK(drop_range_partition_using_CLI(lower_bound, upper_bound, lower_bound_type_internal, upper_bound_type_internal)); - ASSERT_OK(client_->OpenTable(kTestTableName, &table)); - // Verify no rows are left. - ASSERT_EQ(0, CountTableRows(table.get())); + ASSERT_EVENTUALLY([&]() { + ASSERT_OK(client_->OpenTable(kTestTableName, &table)); + // Verify no rows are left. + ASSERT_EQ(0, CountTableRows(table.get())); + }); }; { @@ -2556,8 +2561,10 @@ TEST_F(AdminCliTest, TestAddAndDropRangePartition) { // Drop range partition of [0,100) by command line, now there are 0 rows left. ASSERT_OK(drop_range_partition_using_CLI("[0]", "[100]", "inclusive_bound", "exclusive_bound")); - ASSERT_OK(client_->OpenTable(kTestTableName, &table)); - ASSERT_EQ(0, CountTableRows(table.get())); + ASSERT_EVENTUALLY([&]() { + ASSERT_OK(client_->OpenTable(kTestTableName, &table)); + ASSERT_EQ(0, CountTableRows(table.get())); + }); } { @@ -2844,8 +2851,10 @@ TEST_F(AdminCliTest, TestAddAndDropRangePartitionForMultipleRangeColumnsTable) { ASSERT_TRUE(s.ok()) << ToolRunInfo(s, stdout, stderr); // There are 0 rows left. - ASSERT_OK(client_->OpenTable(kTestTableName, &table)); - ASSERT_EQ(0, CountTableRows(table.get())); + ASSERT_EVENTUALLY([&]() { + ASSERT_OK(client_->OpenTable(kTestTableName, &table)); + ASSERT_EQ(0, CountTableRows(table.get())); + }); } } // namespace tools