maedhroz commented on code in PR #1855:
URL: https://github.com/apache/cassandra/pull/1855#discussion_r972410813


##########
test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java:
##########
@@ -247,6 +253,23 @@ public void testReadRateTracking()
 
         Util.getAll(Util.cmd(store, key).includeRow("0").build());
         assertEquals(2, sstable.getReadMeter().count());
+
+        // With persistence enabled, we should be able to retrieve the state 
of the meter.
+        sstable.maybePersistSSTableReadMeter();
+
+        UntypedResultSet meter = 
SystemKeyspace.readSSTableActivity(store.keyspace.getName(), store.name, 
sstable.descriptor.id);
+        // So this is the only issue atm; seems like it's empty
+        assertFalse(meter.isEmpty());
+
+        Util.getAll(Util.cmd(store, key).includeRow("0").build());
+        assertEquals(3, sstable.getReadMeter().count());
+
+        // After cleaning existing state and disabling persistence, there 
should be no meter state to read.
+        SystemKeyspace.clearSSTableReadMeter(store.keyspace.getName(), 
store.name, sstable.descriptor.id);
+        DatabaseDescriptor.setSStableReadRatePersistenceEnabled(false);

Review Comment:
   nit: Any risk to any of the other tests if we don't switch back to the 
original setting?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to