Repository: cassandra
Updated Branches:
  refs/heads/trunk 7e362e78c -> 69db2359e


Reset CDCSpaceInMB after each test

patch by Jay Zhuang; reviewed by jmckenzie for CASSANDRA-14195


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

Branch: refs/heads/trunk
Commit: 69db2359ee0889cb4a57aec179b9821ff442d26b
Parents: 7e362e7
Author: Jay Zhuang <jay.zhu...@yahoo.com>
Authored: Sun Jan 28 15:43:32 2018 -0800
Committer: Josh McKenzie <jmcken...@apache.org>
Committed: Tue Jan 30 10:02:25 2018 -0500

----------------------------------------------------------------------
 .../db/commitlog/CommitLogSegmentManagerCDCTest.java     | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/69db2359/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
----------------------------------------------------------------------
diff --git 
a/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
 
b/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
index d9bf493..8c0647c 100644
--- 
a/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
+++ 
b/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
@@ -188,6 +188,8 @@ public class CommitLogSegmentManagerCDCTest extends 
CQLTester
     {
         createTable("CREATE TABLE %s (idx int, data text, primary key(idx)) 
WITH cdc=true;");
         CommitLogSegment initialSegment = 
CommitLog.instance.segmentManager.allocatingFrom();
+        Integer originalCDCSize = DatabaseDescriptor.getCDCSpaceInMB();
+
         DatabaseDescriptor.setCDCSpaceInMB(8);
         try
         {
@@ -202,6 +204,10 @@ public class CommitLogSegmentManagerCDCTest extends 
CQLTester
         {
             // pass. Expected since we'll have a file or two linked on restart 
of CommitLog due to replay
         }
+        finally
+        {
+            DatabaseDescriptor.setCDCSpaceInMB(originalCDCSize);
+        }
 
         CommitLog.instance.forceRecycleAllSegments();
 
@@ -275,6 +281,7 @@ public class CommitLogSegmentManagerCDCTest extends 
CQLTester
     {
         // Assert.assertEquals(0, new 
File(DatabaseDescriptor.getCDCLogLocation()).listFiles().length);
         String table_name = createTable("CREATE TABLE %s (idx int, data text, 
primary key(idx)) WITH cdc=true;");
+        Integer originalCDCSize = DatabaseDescriptor.getCDCSpaceInMB();
 
         DatabaseDescriptor.setCDCSpaceInMB(8);
         TableMetadata ccfm = 
Keyspace.open(keyspace()).getColumnFamilyStore(table_name).metadata();
@@ -292,6 +299,10 @@ public class CommitLogSegmentManagerCDCTest extends 
CQLTester
         {
             // pass
         }
+        finally
+        {
+            DatabaseDescriptor.setCDCSpaceInMB(originalCDCSize);
+        }
 
         CommitLog.instance.sync(true);
         CommitLog.instance.stopUnsafe(false);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to