kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject incubator-kudu git commit: deltafile-test: fix TestEmptyFileIsAborted for file block manager
Date Fri, 01 Jul 2016 02:02:20 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 3e3917344 -> 6ff6f289b


deltafile-test: fix TestEmptyFileIsAborted for file block manager

This should improve life for the macOS folks.

I thought about explicitly aborting the block (to delete it) in
DeltaFileWriter::Abort(), but reasoned that the impact would be minimal, as
DeltaFileWriters are short-lived to begin with, and as best I can tell, no
code depends on those blocks vanishing immediately.

Change-Id: Icc27ac5555ceb49a010b2b4fbc5123e0c4fdfb5a
Reviewed-on: http://gerrit.cloudera.org:8080/3546
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


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

Branch: refs/heads/master
Commit: 6ff6f289b2ac63e97ca97760825be18ffb0a7c0c
Parents: 3e39173
Author: Adar Dembo <adar@cloudera.com>
Authored: Thu Jun 30 16:41:56 2016 -0700
Committer: Adar Dembo <adar@cloudera.com>
Committed: Fri Jul 1 02:01:31 2016 +0000

----------------------------------------------------------------------
 src/kudu/tablet/deltafile-test.cc | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/6ff6f289/src/kudu/tablet/deltafile-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/deltafile-test.cc b/src/kudu/tablet/deltafile-test.cc
index 7cd2469..87d6dd3 100644
--- a/src/kudu/tablet/deltafile-test.cc
+++ b/src/kudu/tablet/deltafile-test.cc
@@ -367,14 +367,18 @@ TEST_F(TestDeltaFile, TestEmptyFileIsAborted) {
   gscoped_ptr<WritableBlock> block;
   ASSERT_OK(fs_manager_->CreateNewBlock(&block));
   test_block_ = block->id();
-  DeltaFileWriter dfw(std::move(block));
-  ASSERT_OK(dfw.Start());
-  Status s = dfw.Finish();
-  ASSERT_TRUE(s.IsAborted());
+  {
+    DeltaFileWriter dfw(std::move(block));
+    ASSERT_OK(dfw.Start());
+
+    // The block is only deleted when the DeltaFileWriter goes out of scope.
+    Status s = dfw.Finish();
+    ASSERT_TRUE(s.IsAborted());
+  }
 
   // The block should have been deleted as well.
   gscoped_ptr<ReadableBlock> rb;
-  s = fs_manager_->OpenBlock(test_block_, &rb);
+  Status s = fs_manager_->OpenBlock(test_block_, &rb);
   ASSERT_TRUE(s.IsNotFound()) << s.ToString();
 }
 


Mime
View raw message