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

alexey pushed a commit to branch branch-1.17.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 9de4325a1a62f05ff29e6000daf60df4ef622e24
Author: kedeng <kdeng...@gmail.com>
AuthorDate: Tue Apr 9 16:57:57 2024 +0800

    KUDU-3433 Fix flakiness in 
ClientTest.TestDeleteWithDeletedTableReserveSecondsWorks
    
    The reason for the flakiness of the unit test is that we did not consider 
corner
    cases, namely, the time reserved from detecting a table in soft-deleted 
state
    until the execution of deletion, during which some operations may occur. We 
need
    to reserve more time.
    
    However, in order to verify that FLAGS_table_reserve_seconds is indeed 
effective,
    the additional time cannot be too long. Taking these two factors into 
consideration,
    I added one second of waiting time and performed multiple tests locally 
using the
    gtest_repeat parameter to ensure that this modification is effective.
    
    Change-Id: Iab3a6a5f54701470e368c043133f4646aa71126d
    Reviewed-on: http://gerrit.cloudera.org:8080/21268
    Tested-by: Alexey Serbin <ale...@apache.org>
    Reviewed-by: Alexey Serbin <ale...@apache.org>
    (cherry picked from commit e5f3d2b19e7a210f64e76584fbe53454886668cb)
    Reviewed-on: http://gerrit.cloudera.org:8080/21272
    Reviewed-by: Yingchun Lai <laiyingc...@apache.org>
---
 src/kudu/client/client-test.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index dfc250348..1b0ccd7e1 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -5428,7 +5428,8 @@ TEST_F(ClientTest, 
TestDeleteWithDeletedTableReserveSecondsWorks) {
   ASSERT_TRUE(tables.empty());
 
   // Test FLAGS_table_reserve_seconds.
-  SleepFor(MonoDelta::FromMilliseconds(5 * 1000));
+  // We allow a bit more time than reserved to avoid corner cases.
+  SleepFor(MonoDelta::FromMilliseconds(6 * 1000));
 
   // No tables left.
   ASSERT_OK(client_->ListTables(&tables));

Reply via email to