adelapena commented on a change in pull request #1150:
URL: https://github.com/apache/cassandra/pull/1150#discussion_r707223698



##########
File path: test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
##########
@@ -137,7 +146,80 @@ public void cleanUp()
     }
 
     @Test
-    public void testSingleExpressionQueries()
+    public void testSASIComponentsAddedToSnapshot() throws Throwable
+    {
+        String snapshotName = "sasi_test";
+        Map<String, Pair<String, Integer>> data = new HashMap<>();
+        Random r = new Random();
+
+        for (int i = 0; i < 100; i++)
+            data.put(UUID.randomUUID().toString(), 
Pair.create(UUID.randomUUID().toString(), r.nextInt()));
+
+        ColumnFamilyStore store = loadData(data, true);
+        store.forceMajorCompaction();
+
+        try
+        {
+            Set<SSTableReader> ssTableReaders = store.getLiveSSTables();
+            Set<Component> sasiComponents = new HashSet<>();
+
+            for (Index index : store.indexManager.listIndexes())
+                if (index instanceof SASIIndex)
+                    sasiComponents.add(((SASIIndex) 
index).getIndex().getComponent());
+
+            Assert.assertFalse(sasiComponents.isEmpty());

Review comment:
       Nit: this could be out of the try-finally block, so the first statement 
of the block is taking the snapshot




-- 
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