cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject cassandra git commit: fix TrackerTest to handle new notifications
Date Wed, 17 Feb 2016 23:34:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 27ac6a836 -> 29d556872


fix TrackerTest to handle new notifications

patch by xedin; reviewed by yukim for CASSANDRA-11178


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

Branch: refs/heads/trunk
Commit: 29d5568724a5ba80642cb58ed829d5c961fff41d
Parents: 27ac6a8
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Wed Feb 17 15:07:31 2016 -0800
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Wed Feb 17 15:33:04 2016 -0800

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../apache/cassandra/db/lifecycle/TrackerTest.java | 17 +++++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/29d55687/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index df97bbd..e6d4c42 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.4
+ * fix TrackerTest to handle new notifications (CASSANDRA-11178)
  * add SASI validation for partitioner and complex columns (CASSANDRA-11169)
  * Add caching of encrypted credentials in PasswordAuthenticator (CASSANDRA-7715)
  * fix SASI memtable switching on flush (CASSANDRA-11159)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/29d55687/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java b/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
index 4f49389..b3dc3d9 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
@@ -280,8 +280,9 @@ public class TrackerTest
         Assert.assertEquals(prev1, tracker.getMemtableFor(write1, ReplayPosition.NONE));
         Assert.assertEquals(prev2, tracker.getMemtableFor(write2, ReplayPosition.NONE));
         Assert.assertEquals(cur, tracker.getMemtableFor(writecur, ReplayPosition.NONE));
-        Assert.assertEquals(1, listener.received.size());
+        Assert.assertEquals(2, listener.received.size());
         Assert.assertTrue(listener.received.get(0) instanceof MemtableRenewedNotification);
+        Assert.assertTrue(listener.received.get(1) instanceof MemtableSwitchedNotification);
         listener.received.clear();
 
         tracker.markFlushing(prev2);
@@ -299,8 +300,9 @@ public class TrackerTest
         SSTableReader reader = MockSchema.sstable(0, 10, false, cfs);
         tracker.replaceFlushed(prev2, singleton(reader));
         Assert.assertEquals(1, tracker.getView().sstables.size());
-        Assert.assertEquals(1, listener.received.size());
+        Assert.assertEquals(2, listener.received.size());
         Assert.assertEquals(singleton(reader), ((SSTableAddedNotification) listener.received.get(0)).added);
+        Assert.assertEquals(prev2, ((MemtableDiscardedNotification) listener.received.get(1)).memtable);
         listener.received.clear();
         Assert.assertTrue(reader.isKeyCacheSetup());
         Assert.assertEquals(10, cfs.metric.liveDiskSpaceUsed.getCount());
@@ -318,10 +320,13 @@ public class TrackerTest
         Assert.assertEquals(0, tracker.getView().sstables.size());
         Assert.assertEquals(0, tracker.getView().flushingMemtables.size());
         Assert.assertEquals(0, cfs.metric.liveDiskSpaceUsed.getCount());
-        Assert.assertEquals(3, listener.received.size());
-        Assert.assertEquals(singleton(reader), ((SSTableAddedNotification) listener.received.get(0)).added);
-        Assert.assertTrue(listener.received.get(1) instanceof SSTableDeletingNotification);
-        Assert.assertEquals(1, ((SSTableListChangedNotification) listener.received.get(2)).removed.size());
+        System.out.println(listener.received);
+        Assert.assertEquals(5, listener.received.size());
+        Assert.assertEquals(prev1, ((MemtableSwitchedNotification) listener.received.get(0)).memtable);
+        Assert.assertEquals(singleton(reader), ((SSTableAddedNotification) listener.received.get(1)).added);
+        Assert.assertEquals(prev1, ((MemtableDiscardedNotification) listener.received.get(2)).memtable);
+        Assert.assertTrue(listener.received.get(3) instanceof SSTableDeletingNotification);
+        Assert.assertEquals(1, ((SSTableListChangedNotification) listener.received.get(4)).removed.size());
         DatabaseDescriptor.setIncrementalBackupsEnabled(backups);
     }
 


Mime
View raw message