cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject cassandra git commit: Fix logs about reference leaks in IndexSummaryTests
Date Thu, 26 Mar 2015 22:59:36 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 7ff25f0df -> b66092f90


Fix logs about reference leaks in IndexSummaryTests


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

Branch: refs/heads/cassandra-2.1
Commit: b66092f904c380d943f75b2a7cef033929631309
Parents: 7ff25f0
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Thu Mar 26 17:58:57 2015 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Thu Mar 26 17:58:57 2015 -0500

----------------------------------------------------------------------
 .../unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b66092f9/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
index 9ed5b32..c9322b0 100644
--- a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
@@ -49,6 +49,7 @@ public class IndexSummaryTest
         Pair<List<DecoratedKey>, IndexSummary> random = generateRandomIndex(100,
1);
         for (int i = 0; i < 100; i++)
             assertEquals(random.left.get(i).getKey(), ByteBuffer.wrap(random.right.getKey(i)));
+        random.right.close();
     }
 
     @Test
@@ -57,6 +58,7 @@ public class IndexSummaryTest
         Pair<List<DecoratedKey>, IndexSummary> random = generateRandomIndex(100,
1);
         for (int i = 0; i < 100; i++)
             assertEquals(i, random.right.binarySearch(random.left.get(i)));
+        random.right.close();
     }
 
     @Test
@@ -65,6 +67,7 @@ public class IndexSummaryTest
         Pair<List<DecoratedKey>, IndexSummary> random = generateRandomIndex(100,
2);
         for (int i = 0; i < 50; i++)
             assertEquals(i*2, random.right.getPosition(i));
+        random.right.close();
     }
 
     @Test
@@ -84,6 +87,7 @@ public class IndexSummaryTest
         // read the junk
         assertEquals(dis.readUTF(), "JUNK");
         assertEquals(dis.readUTF(), "JUNK");
+        is.close();
         FileUtils.closeQuietly(dis);
     }
 
@@ -107,6 +111,8 @@ public class IndexSummaryTest
             assertEquals(1, loaded.size());
             assertEquals(summary.getPosition(0), loaded.getPosition(0));
             assertArrayEquals(summary.getKey(0), summary.getKey(0));
+            summary.close();
+            loaded.close();
         }
     }
 


Mime
View raw message