Skip to content

Commit

Permalink
Tweak flaky test for more information
Browse files Browse the repository at this point in the history
  • Loading branch information
blambov committed Jul 5, 2023
1 parent b6de426 commit fb343de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
import org.apache.cassandra.db.*;
import org.apache.cassandra.db.marshal.LongType;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.io.sstable.CorruptSSTableException;
import org.apache.cassandra.io.sstable.format.SSTableReader;
import org.apache.cassandra.io.util.File;
import org.apache.cassandra.io.util.FileUtils;
import org.apache.cassandra.schema.*;
import org.apache.cassandra.utils.Throwables;

import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -223,16 +225,15 @@ public void testCorruptedSSTables(String tableName) throws Exception
try
{
cfs.forceMajorCompaction();
break;
}
catch (Exception e)
{
// kind of a hack since we're not specifying just CorruptSSTableExceptions, or (what we actually expect)
// an ExecutionException wrapping a CSSTE. This is probably Good Enough though, since if there are
// other errors in compaction presumably the other tests would bring that to light.
// This is the expected path. The SSTable should be marked corrupted, and retrying the compaction
// should move on to the next corruption.
Throwables.assertAnyCause(e, CorruptSSTableException.class);
failures++;
continue;
}
break;
}

cfs.truncateBlocking();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

import org.apache.cassandra.Util;
import org.apache.cassandra.config.Config;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.cql3.CQLTester;
Expand Down

0 comments on commit fb343de

Please sign in to comment.