kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject kudu git commit: tablet_copy-itest: fix flaky TestMetricsResetAfterRevival
Date Tue, 28 Nov 2017 01:12:34 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 34ca99b62 -> b29c93734

tablet_copy-itest: fix flaky TestMetricsResetAfterRevival

The test aimed to assert that metrics would reset after successfully
bootstrapping the tablet. It originally used the condition that the
metadata reached TABLET_DATA_READY to ensure bootstrapping completed,
which may not be the case. E.g. during tablet copies, the data is copied
over in TABLET_DATA_READY state, and then the Tablet is bootstrapped
(and only then are the metrics reset).

This patch updates the test to ensure bootstrapping completes by instead
checking the number of running tablets reaches 1.

I validated this by adding a sleep statement just before OpenTablet() in
the tablet copy code (where the metadata has reached TABLET_DATA_READY
but has yet to bootstrap) and seeing 100/100 failures. With the fix,
this case passes.

Change-Id: Icec1eb2cb8b9569c27210d0342087b1b05169046
Reviewed-on: http://gerrit.cloudera.org:8080/8651
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Reviewed-by: Mike Percy <mpercy@apache.org>
Tested-by: Kudu Jenkins

Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/b29c9373
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/b29c9373
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/b29c9373

Branch: refs/heads/master
Commit: b29c9373471927d3f2dfbdab03a8bd728c73d82f
Parents: 34ca99b
Author: Andrew Wong <awong@cloudera.com>
Authored: Mon Nov 27 14:53:28 2017 -0800
Committer: Andrew Wong <awong@cloudera.com>
Committed: Tue Nov 28 01:05:57 2017 +0000

 src/kudu/integration-tests/tablet_copy-itest.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/kudu/integration-tests/tablet_copy-itest.cc b/src/kudu/integration-tests/tablet_copy-itest.cc
index 1cb0171..74ecad7 100644
--- a/src/kudu/integration-tests/tablet_copy-itest.cc
+++ b/src/kudu/integration-tests/tablet_copy-itest.cc
@@ -1745,10 +1745,10 @@ TEST_F(TabletCopyITest, TestMetricsResetAfterRevival) {
     ASSERT_OK(DeleteTablet(follower_ts, tablet_id, TABLET_DATA_TOMBSTONED, kTimeout));
-  // Wait for the tablet to be revived via tablet copy.
-  ASSERT_OK(inspect_->WaitForTabletDataStateOnTS(follower_index, tablet_id,
-                                                 { tablet::TABLET_DATA_READY },
-                                                 kTimeout));
+  // Wait for the tablet to be successfully bootstrapped.
+    ASSERT_EQ(1, CountRunningTablets(cluster_->tablet_server(follower_index)));
+  });
   // The rows inserted should have reset back to 0.
   ASSERT_EQ(0, CountRowsInserted(cluster_->tablet_server(follower_index)));

View raw message