Test failure: junit.framework.TestSuite.org.apache.cassandra.distributed.test.CASMultiDCTest

Patch by Berenguer Blasi; reviewed by Ekaterina Dimitrova for CASSANDRA-18707
This commit is contained in:
Bereng 2023-09-14 10:55:19 +02:00
parent 8486d678b0
commit 9ccec3dc8c
1 changed files with 15 additions and 2 deletions

View File

@ -674,9 +674,14 @@ public abstract class AbstractCluster<I extends IInstance> implements ICluster<I
}
public void schemaChange(String query, boolean ignoreStoppedInstances, I instance)
{
schemaChange(query, ignoreStoppedInstances, instance, SchemaChangeMonitor.DEFAULT_WAIT_SECONDS, TimeUnit.SECONDS);
}
public void schemaChange(String query, boolean ignoreStoppedInstances, I instance, int waitSchemaAgreementAmount, TimeUnit unit)
{
instance.sync(() -> {
try (SchemaChangeMonitor monitor = new SchemaChangeMonitor())
try (SchemaChangeMonitor monitor = new SchemaChangeMonitor(waitSchemaAgreementAmount, unit))
{
if (ignoreStoppedInstances)
monitor.ignoreStoppedInstances();
@ -788,9 +793,17 @@ public abstract class AbstractCluster<I extends IInstance> implements ICluster<I
*/
public class SchemaChangeMonitor extends ChangeMonitor
{
// See CASSANDRA-18707
static final public int DEFAULT_WAIT_SECONDS = 120;
public SchemaChangeMonitor()
{
super(70, TimeUnit.SECONDS);
super(DEFAULT_WAIT_SECONDS, TimeUnit.SECONDS);
}
public SchemaChangeMonitor(int waitAmount, TimeUnit unit)
{
super(waitAmount, unit);
}
protected IListen.Cancel startPolling(IInstance instance)