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; ...@@ -23,7 +23,6 @@ import io.atomix.resource.ResourceType;
23 import org.apache.commons.collections.keyvalue.DefaultMapEntry; 23 import org.apache.commons.collections.keyvalue.DefaultMapEntry;
24 import org.junit.AfterClass; 24 import org.junit.AfterClass;
25 import org.junit.BeforeClass; 25 import org.junit.BeforeClass;
26 -import org.junit.Ignore;
27 import org.junit.Test; 26 import org.junit.Test;
28 import org.onlab.util.Tools; 27 import org.onlab.util.Tools;
29 28
...@@ -40,7 +39,6 @@ import static org.junit.Assert.assertTrue; ...@@ -40,7 +39,6 @@ import static org.junit.Assert.assertTrue;
40 /** 39 /**
41 * Tests the {@link AsyncConsistentSetMultimap}. 40 * Tests the {@link AsyncConsistentSetMultimap}.
42 */ 41 */
43 -@Ignore
44 public class AsyncConsistentSetMultimapTest extends AtomixTestBase { 42 public class AsyncConsistentSetMultimapTest extends AtomixTestBase {
45 private final String keyOne = "hello"; 43 private final String keyOne = "hello";
46 private final String keyTwo = "goodbye"; 44 private final String keyTwo = "goodbye";
......
...@@ -20,7 +20,6 @@ import com.google.common.collect.Sets; ...@@ -20,7 +20,6 @@ import com.google.common.collect.Sets;
20 import io.atomix.resource.ResourceType; 20 import io.atomix.resource.ResourceType;
21 import org.junit.AfterClass; 21 import org.junit.AfterClass;
22 import org.junit.BeforeClass; 22 import org.junit.BeforeClass;
23 -import org.junit.Ignore;
24 import org.junit.Test; 23 import org.junit.Test;
25 import org.onlab.util.Tools; 24 import org.onlab.util.Tools;
26 import org.onosproject.store.primitives.MapUpdate; 25 import org.onosproject.store.primitives.MapUpdate;
...@@ -51,7 +50,6 @@ import static org.junit.Assert.fail; ...@@ -51,7 +50,6 @@ import static org.junit.Assert.fail;
51 /** 50 /**
52 * Unit tests for {@link AtomixConsistentMap}. 51 * Unit tests for {@link AtomixConsistentMap}.
53 */ 52 */
54 -@Ignore
55 public class AtomixConsistentMapTest extends AtomixTestBase { 53 public class AtomixConsistentMapTest extends AtomixTestBase {
56 54
57 @BeforeClass 55 @BeforeClass
......
...@@ -15,30 +15,28 @@ ...@@ -15,30 +15,28 @@
15 */ 15 */
16 package org.onosproject.store.primitives.resources.impl; 16 package org.onosproject.store.primitives.resources.impl;
17 17
18 -import java.util.LinkedList; 18 +import io.atomix.Atomix;
19 -import java.util.Queue; 19 +import io.atomix.AtomixClient;
20 -import java.util.concurrent.CompletableFuture; 20 +import io.atomix.resource.ResourceType;
21 -import java.util.function.Consumer;
22 -
23 import org.junit.AfterClass; 21 import org.junit.AfterClass;
24 import org.junit.BeforeClass; 22 import org.junit.BeforeClass;
25 -import org.junit.Ignore;
26 import org.junit.Test; 23 import org.junit.Test;
27 -
28 -import static org.junit.Assert.*;
29 -
30 import org.onosproject.cluster.Leadership; 24 import org.onosproject.cluster.Leadership;
31 import org.onosproject.cluster.NodeId; 25 import org.onosproject.cluster.NodeId;
32 import org.onosproject.event.Change; 26 import org.onosproject.event.Change;
33 27
34 -import io.atomix.Atomix; 28 +import java.util.LinkedList;
35 -import io.atomix.AtomixClient; 29 +import java.util.Queue;
36 -import io.atomix.resource.ResourceType; 30 +import java.util.concurrent.CompletableFuture;
31 +import java.util.function.Consumer;
32 +
33 +import static org.junit.Assert.assertEquals;
34 +import static org.junit.Assert.assertFalse;
35 +import static org.junit.Assert.assertTrue;
37 36
38 /** 37 /**
39 * Unit tests for {@link AtomixLeaderElector}. 38 * Unit tests for {@link AtomixLeaderElector}.
40 */ 39 */
41 -@Ignore
42 public class AtomixLeaderElectorTest extends AtomixTestBase { 40 public class AtomixLeaderElectorTest extends AtomixTestBase {
43 41
44 NodeId node1 = new NodeId("node1"); 42 NodeId node1 = new NodeId("node1");
......
...@@ -20,7 +20,6 @@ import io.atomix.resource.ResourceType; ...@@ -20,7 +20,6 @@ import io.atomix.resource.ResourceType;
20 import io.atomix.variables.DistributedLong; 20 import io.atomix.variables.DistributedLong;
21 import org.junit.AfterClass; 21 import org.junit.AfterClass;
22 import org.junit.BeforeClass; 22 import org.junit.BeforeClass;
23 -import org.junit.Ignore;
24 import org.junit.Test; 23 import org.junit.Test;
25 24
26 import static org.junit.Assert.assertEquals; 25 import static org.junit.Assert.assertEquals;
...@@ -30,7 +29,6 @@ import static org.junit.Assert.assertTrue; ...@@ -30,7 +29,6 @@ import static org.junit.Assert.assertTrue;
30 /**git s 29 /**git s
31 * Unit tests for {@link AtomixCounter}. 30 * Unit tests for {@link AtomixCounter}.
32 */ 31 */
33 -@Ignore
34 public class AtomixLongTest extends AtomixTestBase { 32 public class AtomixLongTest extends AtomixTestBase {
35 33
36 @BeforeClass 34 @BeforeClass
......
...@@ -30,10 +30,6 @@ import io.atomix.resource.ResourceType; ...@@ -30,10 +30,6 @@ import io.atomix.resource.ResourceType;
30 import org.onlab.junit.TestTools; 30 import org.onlab.junit.TestTools;
31 import org.onosproject.store.primitives.impl.CatalystSerializers; 31 import org.onosproject.store.primitives.impl.CatalystSerializers;
32 32
33 -import java.io.File;
34 -import java.io.IOException;
35 -import java.nio.file.Files;
36 -import java.time.Duration;
37 import java.util.ArrayList; 33 import java.util.ArrayList;
38 import java.util.List; 34 import java.util.List;
39 import java.util.concurrent.CompletableFuture; 35 import java.util.concurrent.CompletableFuture;
...@@ -44,7 +40,6 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -44,7 +40,6 @@ import java.util.concurrent.atomic.AtomicInteger;
44 * Base class for various Atomix tests. 40 * Base class for various Atomix tests.
45 */ 41 */
46 public abstract class AtomixTestBase { 42 public abstract class AtomixTestBase {
47 - protected static File testDir;
48 protected static LocalServerRegistry registry = new LocalServerRegistry(); 43 protected static LocalServerRegistry registry = new LocalServerRegistry();
49 protected static List<Address> members = new ArrayList<>(); 44 protected static List<Address> members = new ArrayList<>();
50 protected static List<CopycatClient> copycatClients = new ArrayList<>(); 45 protected static List<CopycatClient> copycatClients = new ArrayList<>();
...@@ -78,7 +73,6 @@ public abstract class AtomixTestBase { ...@@ -78,7 +73,6 @@ public abstract class AtomixTestBase {
78 */ 73 */
79 protected static List<CopycatServer> createCopycatServers(int nodes) 74 protected static List<CopycatServer> createCopycatServers(int nodes)
80 throws Throwable { 75 throws Throwable {
81 - CountDownLatch latch = new CountDownLatch(nodes);
82 List<CopycatServer> servers = new ArrayList<>(); 76 List<CopycatServer> servers = new ArrayList<>();
83 77
84 List<Address> members = new ArrayList<>(); 78 List<Address> members = new ArrayList<>();
...@@ -88,7 +82,7 @@ public abstract class AtomixTestBase { ...@@ -88,7 +82,7 @@ public abstract class AtomixTestBase {
88 members.add(address); 82 members.add(address);
89 CopycatServer server = createCopycatServer(address); 83 CopycatServer server = createCopycatServer(address);
90 if (members.size() <= 1) { 84 if (members.size() <= 1) {
91 - server.bootstrap().thenRun(latch::countDown).join(); 85 + server.bootstrap().join();
92 } else { 86 } else {
93 server.join(members).join(); 87 server.join(members).join();
94 } 88 }
...@@ -109,9 +103,6 @@ public abstract class AtomixTestBase { ...@@ -109,9 +103,6 @@ public abstract class AtomixTestBase {
109 .build()) 103 .build())
110 .withStateMachine(ResourceManagerState::new) 104 .withStateMachine(ResourceManagerState::new)
111 .withSerializer(serializer.clone()) 105 .withSerializer(serializer.clone())
112 - .withHeartbeatInterval(Duration.ofMillis(25))
113 - .withElectionTimeout(Duration.ofMillis(50))
114 - .withSessionTimeout(Duration.ofMillis(100))
115 .build(); 106 .build();
116 copycatServers.add(server); 107 copycatServers.add(server);
117 return server; 108 return server;
...@@ -137,24 +128,6 @@ public abstract class AtomixTestBase { ...@@ -137,24 +128,6 @@ public abstract class AtomixTestBase {
137 copycatServers = new ArrayList<>(); 128 copycatServers = new ArrayList<>();
138 } 129 }
139 130
140 - /**
141 - * Deletes a directory recursively.
142 - */
143 - private void deleteDirectory(File directory) throws IOException {
144 - if (directory.exists()) {
145 - File[] files = directory.listFiles();
146 - if (files != null) {
147 - for (File file : files) {
148 - if (file.isDirectory()) {
149 - deleteDirectory(file);
150 - } else {
151 - Files.delete(file.toPath());
152 - }
153 - }
154 - }
155 - Files.delete(directory.toPath());
156 - }
157 - }
158 131
159 /** 132 /**
160 * Creates a Atomix client. 133 * Creates a Atomix client.
......