@Test public void testCheckForExpiredSSTableBlockers() throws InterruptedException { String KEYSPACE1 = "Keyspace1"; ColumnFamilyStore cfs = Keyspace.open("Keyspace1").getColumnFamilyStore("Standard1"); cfs.truncateBlocking(); cfs.disableAutoCompaction(); cfs.metadata.gcGraceSeconds(0); RowMutation rm = new RowMutation(KEYSPACE1, Util.dk("test").key); rm.add( "Standard1", ByteBufferUtil.bytes("col1"), ByteBufferUtil.EMPTY_BYTE_BUFFER, System.currentTimeMillis()); rm.applyUnsafe(); cfs.forceBlockingFlush(); SSTableReader blockingSSTable = cfs.getSSTables().iterator().next(); for (int i = 0; i < 10; i++) { rm = new RowMutation(KEYSPACE1, Util.dk("test").key); rm.delete("Standard1", System.currentTimeMillis()); rm.applyUnsafe(); cfs.forceBlockingFlush(); } Multimap<SSTableReader, SSTableReader> blockers = SSTableExpiredBlockers.checkForExpiredSSTableBlockers( cfs.getSSTables(), (int) (System.currentTimeMillis() / 1000) + 100); assertEquals(1, blockers.keySet().size()); assertTrue(blockers.keySet().contains(blockingSSTable)); assertEquals(10, blockers.get(blockingSSTable).size()); }