You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/12/12 04:55:14 UTC
[4/5] kudu git commit: Attempt to make
tablet_copy_client_session-itest less flaky
Attempt to make tablet_copy_client_session-itest less flaky
I'm having trouble reproducing the errors seen on EC2 but I'm hoping
this will make the test less flaky on the test dashboard. Let's see.
Change-Id: If076e7997e95335d25346492938764ccb283f813
Reviewed-on: http://gerrit.cloudera.org:8080/5468
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/770f8e13
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/770f8e13
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/770f8e13
Branch: refs/heads/master
Commit: 770f8e134a2d4d38619ee15505474a742607247f
Parents: 88745f3
Author: Mike Percy <mp...@apache.org>
Authored: Sun Dec 11 08:17:04 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Mon Dec 12 04:49:48 2016 +0000
----------------------------------------------------------------------
.../tablet_copy_client_session-itest.cc | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/770f8e13/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/tablet_copy_client_session-itest.cc b/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
index 4a2935f..304c9b5 100644
--- a/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
+++ b/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#include <stdlib.h>
+
#include <boost/optional.hpp>
#include "kudu/common/wire_protocol.h"
@@ -90,7 +92,11 @@ void TabletCopyClientSessionITest::PrepareClusterForTabletCopy(
// Regression test for KUDU-1785. Ensure that starting a tablet copy session
// while a tablet is bootstrapping will result in a simple failure, not a crash.
TEST_F(TabletCopyClientSessionITest, TestStartTabletCopyWhileSourceBootstrapping) {
- const MonoDelta kTimeout = MonoDelta::FromSeconds(60);
+ if (!AllowSlowTests()) {
+ LOG(INFO) << "Test only runs in slow test mode";
+ return;
+ }
+ const MonoDelta kTimeout = MonoDelta::FromSeconds(90); // Can be very slow on TSAN.
NO_FATALS(PrepareClusterForTabletCopy());
TServerDetails* ts0 = ts_map_[cluster_->tablet_server(0)->uuid()];
@@ -119,7 +125,8 @@ TEST_F(TabletCopyClientSessionITest, TestStartTabletCopyWhileSourceBootstrapping
Status s;
while (true) {
if (MonoTime::Now() > deadline) {
- FAIL() << "Timed out waiting for bootstrap: " << s.ToString();
+ LOG(WARNING) << "Test thread timed out waiting for bootstrap: " << s.ToString();
+ return;
}
s = StartTabletCopy(ts1, tablet_id, ts0->uuid(), src_addr, 0,
deadline - MonoTime::Now());
@@ -130,11 +137,11 @@ TEST_F(TabletCopyClientSessionITest, TestStartTabletCopyWhileSourceBootstrapping
if (s.ok()) {
break;
}
- SleepFor(MonoDelta::FromMilliseconds(10));
+ SleepFor(MonoDelta::FromMilliseconds(rand() % 50));
continue;
}
- LOG(INFO) << "Waiting until tablet running...";
- EXPECT_OK(WaitUntilTabletRunning(ts1, tablet_id, deadline - MonoTime::Now()));
+ // If we got here, we either successfully started a tablet copy or we
+ // observed the tablet running.
}, &t));
threads.push_back(t);
}
@@ -144,7 +151,7 @@ TEST_F(TabletCopyClientSessionITest, TestStartTabletCopyWhileSourceBootstrapping
// Wait for one of the threads to succeed with its tablet copy and for the
// tablet to be running on TS 1.
- EXPECT_OK(WaitUntilTabletRunning(ts1, tablet_id, kTimeout));
+ ASSERT_OK(WaitUntilTabletRunning(ts1, tablet_id, kTimeout));
for (auto& t : threads) {
t->Join();