itests: add NO_FATALS in a few places Saw this when I was triaging the following test failure:
F0407 11:28:52.857076 17095 master_main.cc:74] Check failed: <elided> F0407 11:28:52.873128 17085 external_mini_cluster.cc:675] Check failed: !masters_.empty() *** Check failure stack trace: *** @ 0x7f2cbac6e31d google::LogMessage::Fail() at ??:0 @ 0x7f2cbac701dd google::LogMessage::SendToLog() at ??:0 @ 0x7f2cbac6de59 google::LogMessage::Flush() at ??:0 @ 0x7f2cbac70c7f google::LogMessageFatal::~LogMessageFatal() at ??:0 @ 0x7f2ccf8be554 kudu::cluster::ExternalMiniCluster::CreateClient() at ??:0 @ 0x59f35f kudu::LinkedListTest::ResetClientAndTester() @ 0x58deba kudu::LinkedListTest::BuildAndStart() @ 0x57fbc3 kudu::LinkedListTest_TestLoadAndVerify_Test::TestBody() The first failure should have stopped the rest of the test from running, but it didn't due to missing NO_FATALS checks. Change-Id: I5fe0c7dce79cdb8489a860b0b0b5f3a95cfb2cc0 Reviewed-on: http://gerrit.cloudera.org:8080/9955 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <mpe...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/337a731c Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/337a731c Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/337a731c Branch: refs/heads/master Commit: 337a731c47bbc58f320ca32fe50fea6722d01b94 Parents: 13ea104 Author: Adar Dembo <a...@cloudera.com> Authored: Mon Apr 9 11:34:46 2018 -0700 Committer: Mike Percy <mpe...@apache.org> Committed: Mon Apr 9 19:06:47 2018 +0000 ---------------------------------------------------------------------- src/kudu/integration-tests/linked_list-test.cc | 4 ++-- src/kudu/integration-tests/raft_consensus-itest.cc | 6 +++--- .../raft_consensus_election-itest.cc | 15 ++++++++------- 3 files changed, 13 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/337a731c/src/kudu/integration-tests/linked_list-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/integration-tests/linked_list-test.cc b/src/kudu/integration-tests/linked_list-test.cc index cd15545..4434474 100644 --- a/src/kudu/integration-tests/linked_list-test.cc +++ b/src/kudu/integration-tests/linked_list-test.cc @@ -131,7 +131,7 @@ class LinkedListTest : public tserver::TabletServerIntegrationTestBase { ts_flags.emplace_back("--log_segment_size_mb=1"); } - CreateCluster("linked-list-cluster", ts_flags, common_flags); + NO_FATALS(CreateCluster("linked-list-cluster", ts_flags, common_flags)); ResetClientAndTester(); ASSERT_OK(tester_->CreateLinkedListTable()); WaitForTSAndReplicas(); @@ -162,7 +162,7 @@ TEST_F(LinkedListTest, TestLoadAndVerify) { OverrideFlagForSlowTests("seconds_to_run", "30"); OverrideFlagForSlowTests("stress_flush_compact", "true"); OverrideFlagForSlowTests("stress_wal_gc", "true"); - ASSERT_NO_FATAL_FAILURE(BuildAndStart()); + NO_FATALS(BuildAndStart()); string tablet_id = tablet_replicas_.begin()->first; http://git-wip-us.apache.org/repos/asf/kudu/blob/337a731c/src/kudu/integration-tests/raft_consensus-itest.cc ---------------------------------------------------------------------- diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc index 2529e24..e62da62 100644 --- a/src/kudu/integration-tests/raft_consensus-itest.cc +++ b/src/kudu/integration-tests/raft_consensus-itest.cc @@ -532,7 +532,7 @@ void RaftConsensusITest::CreateClusterForCrashyNodesTests() { // log area. ts_flags.emplace_back("--log_preallocate_segments=false"); - CreateCluster("raft_consensus-itest-crashy-nodes-cluster", ts_flags, {}); + NO_FATALS(CreateCluster("raft_consensus-itest-crashy-nodes-cluster", ts_flags, {})); } void RaftConsensusITest::DoTestCrashyNodes(TestWorkload* workload, int max_rows_to_insert) { @@ -905,7 +905,7 @@ TEST_F(RaftConsensusITest, TestFollowerFallsBehindLeaderGC) { // For example, KUDU-783 reproduces from this test approximately 5% of the // time on a slow-test debug build. TEST_F(RaftConsensusITest, InsertUniqueKeysWithCrashyNodes) { - CreateClusterForCrashyNodesTests(); + NO_FATALS(CreateClusterForCrashyNodesTests()); TestWorkload workload(cluster_.get()); workload.set_write_batch_size(1); @@ -918,7 +918,7 @@ TEST_F(RaftConsensusITest, InsertUniqueKeysWithCrashyNodes) { // locking, may cause deadlocks and other anomalies that cannot be observed when // keys are unique. TEST_F(RaftConsensusITest, InsertDuplicateKeysWithCrashyNodes) { - CreateClusterForCrashyNodesTests(); + NO_FATALS(CreateClusterForCrashyNodesTests()); TestWorkload workload(cluster_.get()); workload.set_write_pattern(TestWorkload::INSERT_WITH_MANY_DUP_KEYS); http://git-wip-us.apache.org/repos/asf/kudu/blob/337a731c/src/kudu/integration-tests/raft_consensus_election-itest.cc ---------------------------------------------------------------------- diff --git a/src/kudu/integration-tests/raft_consensus_election-itest.cc b/src/kudu/integration-tests/raft_consensus_election-itest.cc index 00078bf..b10294a 100644 --- a/src/kudu/integration-tests/raft_consensus_election-itest.cc +++ b/src/kudu/integration-tests/raft_consensus_election-itest.cc @@ -103,7 +103,7 @@ void RaftConsensusElectionITest::CreateClusterForChurnyElectionsTests( ts_flags.insert(ts_flags.end(), extra_ts_flags.cbegin(), extra_ts_flags.cend()); - CreateCluster("raft_consensus-itest-cluster", ts_flags, {}); + NO_FATALS(CreateCluster("raft_consensus-itest-cluster", ts_flags, {})); } void RaftConsensusElectionITest::DoTestChurnyElections(TestWorkload* workload, @@ -187,23 +187,24 @@ TEST_F(RaftConsensusElectionITest, RunLeaderElection) { // crash, despite the frequent re-elections and races. TEST_F(RaftConsensusElectionITest, ChurnyElections) { const int kNumWrites = AllowSlowTests() ? 10000 : 1000; - CreateClusterForChurnyElectionsTests({}); + NO_FATALS(CreateClusterForChurnyElectionsTests({})); TestWorkload workload(cluster_.get()); workload.set_write_batch_size(1); workload.set_num_read_threads(2); - DoTestChurnyElections(&workload, kNumWrites); + NO_FATALS(DoTestChurnyElections(&workload, kNumWrites)); } // The same test, except inject artificial latency when propagating notifications // from the queue back to consensus. This previously reproduced bugs like KUDU-1078 which // normally only appear under high load. TEST_F(RaftConsensusElectionITest, ChurnyElections_WithNotificationLatency) { - CreateClusterForChurnyElectionsTests({"--consensus_inject_latency_ms_in_notifications=50"}); + NO_FATALS(CreateClusterForChurnyElectionsTests( + {"--consensus_inject_latency_ms_in_notifications=50"})); const int kNumWrites = AllowSlowTests() ? 10000 : 1000; TestWorkload workload(cluster_.get()); workload.set_write_batch_size(1); workload.set_num_read_threads(2); - DoTestChurnyElections(&workload, kNumWrites); + NO_FATALS(DoTestChurnyElections(&workload, kNumWrites)); } // The same as TestChurnyElections except insert many duplicated rows. @@ -211,13 +212,13 @@ TEST_F(RaftConsensusElectionITest, ChurnyElections_WithNotificationLatency) { // locking, may cause deadlocks and other anomalies that cannot be observed when // keys are unique. TEST_F(RaftConsensusElectionITest, ChurnyElections_WithDuplicateKeys) { - CreateClusterForChurnyElectionsTests({}); + NO_FATALS(CreateClusterForChurnyElectionsTests({})); const int kNumWrites = AllowSlowTests() ? 10000 : 1000; TestWorkload workload(cluster_.get()); workload.set_write_pattern(TestWorkload::INSERT_WITH_MANY_DUP_KEYS); // Increase the number of rows per batch to get a higher chance of key collision. workload.set_write_batch_size(3); - DoTestChurnyElections(&workload, kNumWrites); + NO_FATALS(DoTestChurnyElections(&workload, kNumWrites)); } // Test automatic leader election by killing leaders.