mirror of https://github.com/apache/cassandra
Wait for compactions to finish in PendingAntiCompactionBytemanTest
Patch by marcuse; reviewed by David Capwell for CASSANDRA-15552
This commit is contained in:
parent
219d209651
commit
1ce58ac2ea
|
|
@ -30,6 +30,7 @@ import com.google.common.collect.Lists;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.apache.cassandra.db.compaction.CompactionInterruptedException;
|
||||
import org.apache.cassandra.db.compaction.CompactionManager;
|
||||
import org.apache.cassandra.dht.Range;
|
||||
import org.apache.cassandra.dht.Token;
|
||||
import org.apache.cassandra.io.sstable.format.SSTableReader;
|
||||
|
|
@ -75,6 +76,9 @@ public class PendingAntiCompactionBytemanTest extends AbstractPendingAntiCompact
|
|||
{
|
||||
assertTrue(e.getCause() instanceof CompactionInterruptedException);
|
||||
}
|
||||
// Note that since we fail the PAC immediately when any of the anticompactions fail we need to wait for the other
|
||||
// AC to finish as well before asserting that we have nothing compacting.
|
||||
CompactionManager.instance.waitForCessation(Lists.newArrayList(cfs, cfs2), (sstable) -> true);
|
||||
// and make sure nothing is marked compacting
|
||||
assertTrue(cfs.getTracker().getCompacting().isEmpty());
|
||||
assertTrue(cfs2.getTracker().getCompacting().isEmpty());
|
||||
|
|
|
|||
Loading…
Reference in New Issue