|
27 | 27 | import java.net.HttpURLConnection;
|
28 | 28 | import java.time.Duration;
|
29 | 29 | import java.util.ArrayList;
|
| 30 | +import java.util.Arrays; |
30 | 31 | import java.util.Collection;
|
31 | 32 | import java.util.List;
|
32 | 33 | import java.util.concurrent.BrokenBarrierException;
|
33 | 34 | import java.util.concurrent.CountDownLatch;
|
34 | 35 | import java.util.concurrent.CyclicBarrier;
|
35 | 36 | import java.util.concurrent.atomic.AtomicInteger;
|
36 | 37 | import java.util.concurrent.atomic.AtomicReference;
|
| 38 | +import okhttp3.Protocol; |
37 | 39 | import org.junit.Assert;
|
38 | 40 | import org.junit.Before;
|
39 | 41 | import org.junit.Test;
|
@@ -73,6 +75,12 @@ public static Collection<Object[]> constructorFeeder() {
|
73 | 75 | public LeaderElectorTest(LockType lockType) {
|
74 | 76 | try {
|
75 | 77 | apiClient = ClientBuilder.defaultClient();
|
| 78 | + apiClient.setHttpClient( |
| 79 | + apiClient |
| 80 | + .getHttpClient() |
| 81 | + .newBuilder() |
| 82 | + .protocols(Arrays.asList(Protocol.HTTP_1_1)) |
| 83 | + .build()); |
76 | 84 | } catch (IOException ex) {
|
77 | 85 | throw new RuntimeException("Couldn't create ApiClient", ex);
|
78 | 86 | }
|
@@ -185,7 +193,7 @@ public void testMultiCandidateLeaderElection() throws Exception {
|
185 | 193 | Assert.assertEquals(1, stopBeingLeaderCount.get());
|
186 | 194 | }
|
187 | 195 |
|
188 |
| - @Test(timeout = 30000L) |
| 196 | + @Test(timeout = 45000L) |
189 | 197 | public void testLeaderGracefulShutdown() throws Exception {
|
190 | 198 | CountDownLatch startBeingLeader1 = new CountDownLatch(1);
|
191 | 199 | CountDownLatch stopBeingLeader1 = new CountDownLatch(1);
|
|
0 commit comments