Repository: kudu Updated Branches: refs/heads/branch-1.3.x d784f04d8 -> 2fcef0e34
util: fix test compilation failures when building with gcc5 Both env-test and env_util-test fail to build with gcc5. The error messages look like this: /home/adar/Source/kudu/src/kudu/util/env_util-test.cc: In lambda function: /home/adar/Source/kudu/src/kudu/util/env_util-test.cc:66:71: error: label 'gtest_label_testnofatal_68' used but not defined /home/adar/Source/kudu/src/kudu/util/env_util-test.cc:66:108: warning: label 'gtest_label_testnofatal_74' defined but not used [-Wunused-label] /home/adar/Source/kudu/src/kudu/util/env_util-test.cc: In member function 'virtual void kudu::env_util::EnvUtilTest_TestDiskSpaceCheck_Test::TestBody()': /home/adar/Source/kudu/src/kudu/util/env_util-test.cc:66:71: error: label 'gtest_label_testnofatal_72' used but not defined /home/adar/Source/kudu/src/kudu/util/env_util-test.cc:66:108: warning: label 'gtest_label_testnofatal_74' defined but not used [-Wunused-label] src/kudu/util/CMakeFiles/env_util-test.dir/build.make:62: recipe for target 'src/kudu/util/CMakeFiles/env_util-test.dir/env_util-test.cc.o' failed make[2]: *** [src/kudu/util/CMakeFiles/env_util-test.dir/env_util-test.cc.o] Error 1 CMakeFiles/Makefile2:17400: recipe for target 'src/kudu/util/CMakeFiles/env_util-test.dir/all' failed make[1]: *** [src/kudu/util/CMakeFiles/env_util-test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... I thought maybe it was due to the NO_FATALS() nesting so I removed the inner calls, but that didn't work. Removing the NO_FATALS() surrounding the AssertEventually() calls does work, however. Change-Id: I93b4b9a4e1d545144a0f82c0839ed6c445a7aec1 Reviewed-on: http://gerrit.cloudera.org:8080/6354 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <[email protected]> (cherry picked from commit 7034bffc1c851024759c8d6f644ee48bb43a1d67) Reviewed-on: http://gerrit.cloudera.org:8080/6357 Reviewed-by: Adar Dembo <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/2fcef0e3 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/2fcef0e3 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/2fcef0e3 Branch: refs/heads/branch-1.3.x Commit: 2fcef0e3444a58602d9492bcfbb71d29f6953219 Parents: d784f04 Author: Adar Dembo <[email protected]> Authored: Fri Mar 10 17:31:44 2017 -0800 Committer: Adar Dembo <[email protected]> Committed: Sat Mar 11 09:06:38 2017 +0000 ---------------------------------------------------------------------- src/kudu/util/env-test.cc | 4 ++-- src/kudu/util/env_util-test.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/2fcef0e3/src/kudu/util/env-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/util/env-test.cc b/src/kudu/util/env-test.cc index a8e5f70..7b216dc 100644 --- a/src/kudu/util/env-test.cc +++ b/src/kudu/util/env-test.cc @@ -812,7 +812,7 @@ TEST_F(TestEnv, TestGetSpaceInfoFreeBytes) { // Loop in case there are concurrent tests running that are modifying the // filesystem. - NO_FATALS(AssertEventually([&] { + AssertEventually([&] { if (env_->FileExists(kTestFilePath)) { ASSERT_OK(env_->DeleteFile(kTestFilePath)); // Clean up the previous iteration. } @@ -824,7 +824,7 @@ TEST_F(TestEnv, TestGetSpaceInfoFreeBytes) { SpaceInfo after_space_info; ASSERT_OK(env_->GetSpaceInfo(kDataDir, &after_space_info)); ASSERT_GE(before_space_info.free_bytes - after_space_info.free_bytes, kFileSizeBytes); - })); + }); } // Basic sanity check for GetSpaceInfo(). http://git-wip-us.apache.org/repos/asf/kudu/blob/2fcef0e3/src/kudu/util/env_util-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/util/env_util-test.cc b/src/kudu/util/env_util-test.cc index d0a7ae3..cee0ffa 100644 --- a/src/kudu/util/env_util-test.cc +++ b/src/kudu/util/env_util-test.cc @@ -63,7 +63,7 @@ TEST_F(EnvUtilTest, TestDiskSpaceCheck) { // Check 1% reservation logic. We loop this in case there are other FS // operations happening concurrent with this test. - NO_FATALS(AssertEventually([&] { + AssertEventually([&] { SpaceInfo space_info; ASSERT_OK(env_->GetSpaceInfo(test_dir_, &space_info)); // Try for 1 less byte than 1% free. This request should be rejected. @@ -71,7 +71,7 @@ TEST_F(EnvUtilTest, TestDiskSpaceCheck) { int64_t bytes_to_request = std::max<int64_t>(0, space_info.free_bytes - target_free_bytes); NO_FATALS(AssertNoSpace(VerifySufficientDiskSpace(env_, test_dir_, bytes_to_request, kRequestOnePercentReservation))); - })); + }); // Make it seem as if the disk is full and specify that we should have // reserved 200 bytes. Even asking for 0 bytes should return an error
