You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by aw...@apache.org on 2019/08/24 00:59:14 UTC

[kudu] 05/05: test: deflake ksck_remote-test TestChecksumSnapshotCurrentTimestamp

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

awong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 8af4883be0d49d4fe69ef697345d1feee799c935
Author: Andrew Wong <aw...@apache.org>
AuthorDate: Fri Jul 19 19:11:40 2019 -0700

    test: deflake ksck_remote-test TestChecksumSnapshotCurrentTimestamp
    
    I saw a failure of the test with the following error:
    
    W0720 00:44:31.890009  4561 tablet_service.cc:2357] Rejecting scan request for tablet 9542a9eebae84c1b993235a309c866d0: Uninitialized: safe time has not yet been initialized
    /data0/jenkins/workspace/kudu-pre-commit-unittest-ASAN/src/kudu/tools/ksck_remote-test.cc:451: Failure
    Failed
    Bad status: Aborted: 1 errors were detected
    
    This patch wraps the checksum with an ASSERT_EVENTUALLY, since the scan
    should eventually pass once a leader is elected or writes succeed.
    
    Change-Id: I51aeaebca599697e444b244ae15259dea4dbe949
    Reviewed-on: http://gerrit.cloudera.org:8080/13887
    Tested-by: Kudu Jenkins
    Reviewed-by: Hao Hao <ha...@cloudera.com>
---
 src/kudu/tools/ksck_remote-test.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index ba4328a..a64e268 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -445,10 +445,14 @@ TEST_F(RemoteKsckTest, TestChecksumSnapshotCurrentTimestamp) {
     ASSERT_OK(ksck_->CheckClusterRunning());
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
     ASSERT_OK(ksck_->FetchInfoFromTabletServers());
-    ASSERT_OK(ksck_->ChecksumData(KsckChecksumOptions(MonoDelta::FromSeconds(10),
-                                                      MonoDelta::FromSeconds(10),
-                                                      16, true,
-                                                      KsckChecksumOptions::kCurrentTimestamp)));
+    // It's possible for scans to fail because the tablets haven't been written
+    // to yet and haven't elected a leader.
+    ASSERT_EVENTUALLY([&] {
+      ASSERT_OK(ksck_->ChecksumData(KsckChecksumOptions(MonoDelta::FromSeconds(10),
+                                                        MonoDelta::FromSeconds(10),
+                                                        16, true,
+                                                        KsckChecksumOptions::kCurrentTimestamp)));
+    });
   }
   ASSERT_OK(promise.Get());
 }