Make reduce flake from KUDU-1642 tests in client-test This ups the timeouts so the tests should be less flaky. It also removes a couple stray zeroes and improves the flush behavior.
Change-Id: Iba01eb7e9976f2fae4061ba918457c946d98c067 Reviewed-on: http://gerrit.cloudera.org:8080/5882 Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/815fd0ac Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/815fd0ac Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/815fd0ac Branch: refs/heads/master Commit: 815fd0ac87952fcfbbffcc2e3e936b49827c53c4 Parents: 02ce2a8 Author: Will Berkeley <[email protected]> Authored: Thu Feb 2 18:07:03 2017 -0500 Committer: Todd Lipcon <[email protected]> Committed: Wed Mar 1 05:57:11 2017 +0000 ---------------------------------------------------------------------- src/kudu/client/client-test.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/815fd0ac/src/kudu/client/client-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc index f34d7cb..f695f7c 100644 --- a/src/kudu/client/client-test.cc +++ b/src/kudu/client/client-test.cc @@ -4248,8 +4248,8 @@ TEST_P(IntEncodingNullPredicatesTest, TestIntEncodings) { // Insert rows. shared_ptr<KuduSession> session = table->client()->NewSession(); ASSERT_OK(session->SetFlushMode(KuduSession::MANUAL_FLUSH)); - session->SetTimeoutMillis(5000); - const size_t kNumRows = AllowSlowTests() ? 10000 : 10000; + session->SetTimeoutMillis(10000); + const size_t kNumRows = AllowSlowTests() ? 10000 : 1000; for (int i = 0; i < kNumRows; i++) { KuduInsert* insert = table->NewInsert(); KuduPartialRow* row = insert->mutable_row(); @@ -4260,7 +4260,7 @@ TEST_P(IntEncodingNullPredicatesTest, TestIntEncodings) { ASSERT_OK(row->SetNull("int_val")); } ASSERT_OK(session->Apply(insert)); - if (i % 10001 == 0) { + if (i + 1 % 1000 == 0) { ASSERT_OK(session->Flush()); } } @@ -4345,7 +4345,7 @@ TEST_P(BinaryEncodingNullPredicatesTest, TestBinaryEncodings) { // Insert rows. shared_ptr<KuduSession> session = table->client()->NewSession(); ASSERT_OK(session->SetFlushMode(KuduSession::MANUAL_FLUSH)); - session->SetTimeoutMillis(5000); + session->SetTimeoutMillis(10000); const size_t kNumRows = AllowSlowTests() ? 10000 : 1000; for (int i = 0; i < kNumRows; i++) { KuduInsert* insert = table->NewInsert(); @@ -4357,7 +4357,7 @@ TEST_P(BinaryEncodingNullPredicatesTest, TestBinaryEncodings) { ASSERT_OK(row->SetNull("string_val")); } ASSERT_OK(session->Apply(insert)); - if (i % 10001 == 0) { + if (i + 1 % 1000 == 0) { ASSERT_OK(session->Flush()); } }
