Aaron Kruglikov
Committed by Gerrit Code Review

Changing sever timeouts to reduce test failures.

Change-Id: Idf18e5309a5a14a4dcf51952a2d736035cc95975
......@@ -23,7 +23,6 @@ import io.atomix.resource.ResourceType;
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.onlab.util.Tools;
......@@ -40,7 +39,6 @@ import static org.junit.Assert.assertTrue;
/**
* Tests the {@link AsyncConsistentSetMultimap}.
*/
@Ignore
public class AsyncConsistentSetMultimapTest extends AtomixTestBase {
private final String keyOne = "hello";
private final String keyTwo = "goodbye";
......
......@@ -20,7 +20,6 @@ import com.google.common.collect.Sets;
import io.atomix.resource.ResourceType;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.onlab.util.Tools;
import org.onosproject.store.primitives.MapUpdate;
......@@ -51,7 +50,6 @@ import static org.junit.Assert.fail;
/**
* Unit tests for {@link AtomixConsistentMap}.
*/
@Ignore
public class AtomixConsistentMapTest extends AtomixTestBase {
@BeforeClass
......
......@@ -15,30 +15,28 @@
*/
package org.onosproject.store.primitives.resources.impl;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import io.atomix.Atomix;
import io.atomix.AtomixClient;
import io.atomix.resource.ResourceType;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
import org.onosproject.cluster.Leadership;
import org.onosproject.cluster.NodeId;
import org.onosproject.event.Change;
import io.atomix.Atomix;
import io.atomix.AtomixClient;
import io.atomix.resource.ResourceType;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Unit tests for {@link AtomixLeaderElector}.
*/
@Ignore
public class AtomixLeaderElectorTest extends AtomixTestBase {
NodeId node1 = new NodeId("node1");
......
......@@ -20,7 +20,6 @@ import io.atomix.resource.ResourceType;
import io.atomix.variables.DistributedLong;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
......@@ -30,7 +29,6 @@ import static org.junit.Assert.assertTrue;
/**git s
* Unit tests for {@link AtomixCounter}.
*/
@Ignore
public class AtomixLongTest extends AtomixTestBase {
@BeforeClass
......
......@@ -30,10 +30,6 @@ import io.atomix.resource.ResourceType;
import org.onlab.junit.TestTools;
import org.onosproject.store.primitives.impl.CatalystSerializers;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
......@@ -44,7 +40,6 @@ import java.util.concurrent.atomic.AtomicInteger;
* Base class for various Atomix tests.
*/
public abstract class AtomixTestBase {
protected static File testDir;
protected static LocalServerRegistry registry = new LocalServerRegistry();
protected static List<Address> members = new ArrayList<>();
protected static List<CopycatClient> copycatClients = new ArrayList<>();
......@@ -78,7 +73,6 @@ public abstract class AtomixTestBase {
*/
protected static List<CopycatServer> createCopycatServers(int nodes)
throws Throwable {
CountDownLatch latch = new CountDownLatch(nodes);
List<CopycatServer> servers = new ArrayList<>();
List<Address> members = new ArrayList<>();
......@@ -88,7 +82,7 @@ public abstract class AtomixTestBase {
members.add(address);
CopycatServer server = createCopycatServer(address);
if (members.size() <= 1) {
server.bootstrap().thenRun(latch::countDown).join();
server.bootstrap().join();
} else {
server.join(members).join();
}
......@@ -109,9 +103,6 @@ public abstract class AtomixTestBase {
.build())
.withStateMachine(ResourceManagerState::new)
.withSerializer(serializer.clone())
.withHeartbeatInterval(Duration.ofMillis(25))
.withElectionTimeout(Duration.ofMillis(50))
.withSessionTimeout(Duration.ofMillis(100))
.build();
copycatServers.add(server);
return server;
......@@ -137,24 +128,6 @@ public abstract class AtomixTestBase {
copycatServers = new ArrayList<>();
}
/**
* Deletes a directory recursively.
*/
private void deleteDirectory(File directory) throws IOException {
if (directory.exists()) {
File[] files = directory.listFiles();
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
deleteDirectory(file);
} else {
Files.delete(file.toPath());
}
}
}
Files.delete(directory.toPath());
}
}
/**
* Creates a Atomix client.
......