nihal0107 commented on a change in pull request #4071: URL: https://github.com/apache/carbondata/pull/4071#discussion_r567674967
########## File path: index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestCreateIndexWithLoadAndCompaction.scala ########## @@ -283,19 +285,32 @@ class TestCreateIndexWithLoadAndCompaction extends QueryTest with BeforeAndAfter } sql("ALTER TABLE table1 COMPACT 'CUSTOM' WHERE SEGMENT.ID IN (1,2,3)") - val segments = sql("SHOW SEGMENTS FOR TABLE idx1") - val segInfos = segments.collect().map { each => - ((each.toSeq) (0).toString, (each.toSeq) (1).toString) - } - assert(segInfos.length == 6) + val segInfos = checkSegmentList(6) assert(segInfos.contains(("0", "Success"))) assert(segInfos.contains(("1", "Compacted"))) assert(segInfos.contains(("2", "Compacted"))) assert(segInfos.contains(("3", "Compacted"))) assert(segInfos.contains(("1.1", "Success"))) assert(segInfos.contains(("4", "Success"))) checkAnswer(sql("select * from table1 where c3='b2'"), Seq(Row(3, "a2", "b2"))) - sql("drop table if exists table1") + + // after clean files + val mock = TestSecondaryIndexUtils.mockreadSegmentList() Review comment: We have mocked here to have some invalid segment in case of clean files for SI. Added assert for those scenario also. This testcase will cover the lines for `CleanFilesPostEventListener.cleanUpUnwantedSegmentsOfSIAndUpdateMetadata` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org