This is an automated email from the ASF dual-hosted git repository.

laiyingchun 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 0616d9604 [unit test] KUDU-3360 Fix 
DisableWriteWhenExceedingQuotaTest.TestDisableWritePrivilegeWhenExceedingSizeQuota
0616d9604 is described below

commit 0616d9604588875364ce1380107a4ecd55440a9c
Author: shenxingwuying <[email protected]>
AuthorDate: Wed Apr 20 16:04:08 2022 +0800

    [unit test] KUDU-3360 Fix 
DisableWriteWhenExceedingQuotaTest.TestDisableWritePrivilegeWhenExceedingSizeQuota
    
    
DisableWriteWhenExceedingQuotaTest.TestDisableWritePrivilegeWhenExceedingSizeQuota
    is not steady and proability fail. Errors at Jenkins like this:
    
    Error Message
    
/home/jenkins-slave/workspace/kudu-master/1/src/kudu/integration-tests/write_limit-itest.cc:229
    Value of: s.IsIOError()
          Actual: false
          Expected: true
          OK
    Stacktrace
    
/home/jenkins-slave/workspace/kudu-master/1/src/kudu/integration-tests/write_limit-itest.cc:229
    Value of: s.IsIOError()
          Actual: false
          Expected: true
          OK
    
    I will try to fix the case, by confirm reaching size_limit and not reach 
row_limit.
    
    Change-Id: Ide7255de177999dcf646a4eda63351e76de2b1cf
    Reviewed-on: http://gerrit.cloudera.org:8080/18426
    Tested-by: Kudu Jenkins
    Reviewed-by: Yingchun Lai <[email protected]>
    Reviewed-by: Alexey Serbin <[email protected]>
---
 src/kudu/integration-tests/write_limit-itest.cc | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/kudu/integration-tests/write_limit-itest.cc 
b/src/kudu/integration-tests/write_limit-itest.cc
index 69f9a6f83..5c52f861c 100644
--- a/src/kudu/integration-tests/write_limit-itest.cc
+++ b/src/kudu/integration-tests/write_limit-itest.cc
@@ -150,7 +150,7 @@ class DisableWriteWhenExceedingQuotaTest : public KuduTest {
   const char* const kTableName = "test-table";
   const char* const kUser = "token-user";
   const char* const kSuperUser = "super-user";
-  const int64_t kRowCountLimit = 20;
+  static const int64_t kRowCountLimit = 20;
 
   void SetUp() override {
     KuduTest::SetUp();
@@ -213,11 +213,11 @@ class DisableWriteWhenExceedingQuotaTest : public 
KuduTest {
   }
 
   // Disable write privilege through authz token when exceeding size quota
-  void TestSizeLimit() {
+  void TestSizeLimit(int64_t row_count_limit = kRowCountLimit) {
     shared_ptr<KuduSession> good_session(client_->NewSession());
     Status s = Status::OK();
     int k = 0;
-    for (k = 0; k < kRowCountLimit; k++) {
+    for (k = 0; k < row_count_limit; k++) {
       ASSERT_OK(InsertKeyToTable(client_table_.get(), good_session.get(), k));
       s = good_session->Flush();
       if (!s.ok()) {
@@ -423,16 +423,17 @@ TEST_F(DisableWriteWhenExceedingQuotaTest, 
TestDisableWritePrivilegeWhenExceedin
   // flush, compaction, and GC jazz performed in the context of 
TestSizeLimit(),
   // taking into account all the auxiliary data kept on disk by corresponding
   // tablet servers.
-  NO_FATALS(ModifyLimit(1024 * (1024 + 110), kRowCountLimit));
+  int64_t row_limit = 100 * kRowCountLimit;
+  NO_FATALS(ModifyLimit(1024 * (1024 + 110), row_limit));
   // refresh the client
   ASSERT_OK(SetupClient(kUser));
-  NO_FATALS(TestSizeLimit());
+  NO_FATALS(TestSizeLimit(row_limit));
 
   // restart the cluster to verify it again
   cluster_->Shutdown();
   ASSERT_OK(cluster_->Start());
   ASSERT_OK(SetupClient(kUser));
-  NO_FATALS(TestSizeLimit());
+  NO_FATALS(TestSizeLimit(row_limit));
 }
 
 TEST_F(DisableWriteWhenExceedingQuotaTest, 
TestDisableWriteWhenExceedingRowsQuotaWithFactor) {

Reply via email to