Fix FailingRepairTest by making sure Gossip is started before each test

patch by Daniel Jatnieks; reviewed by Brandon Williams and Stefan Miklosovic for CASSANDRA-18366
This commit is contained in:
Daniel Jatnieks 2023-09-01 10:45:40 -07:00 committed by Stefan Miklosovic
parent aa2494b30b
commit 0b7310c010
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
1 changed files with 9 additions and 1 deletions

View File

@ -60,6 +60,7 @@ import org.apache.cassandra.distributed.api.ICluster;
import org.apache.cassandra.distributed.api.IIsolatedExecutor.SerializableRunnable;
import org.apache.cassandra.distributed.api.IInvokableInstance;
import org.apache.cassandra.distributed.impl.InstanceKiller;
import org.apache.cassandra.gms.Gossiper;
import org.apache.cassandra.io.sstable.CorruptSSTableException;
import org.apache.cassandra.io.sstable.ISSTableScanner;
import org.apache.cassandra.io.sstable.format.ForwardingSSTableReader;
@ -162,7 +163,14 @@ public class FailingRepairTest extends TestBaseImpl implements Serializable
public void cleanupState()
{
for (int i = 1; i <= CLUSTER.size(); i++)
CLUSTER.get(i).runOnInstance(InstanceKiller::clear);
CLUSTER.get(i).runOnInstance(() -> {
InstanceKiller.clear();
if (!StorageService.instance.isGossipActive())
{
StorageService.instance.startGossiping();
Gossiper.waitToSettle();
}
});
}
@Test(timeout = 10 * 60 * 1000)