Skip to content

Commit eede8dd

Browse files
committed
fixes leader-election e2e flakiness by relaxing timeout to 45s
1 parent 7592454 commit eede8dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

e2e/src/test/java/io/kubernetes/client/e2e/extended/leaderelection/LeaderElectorTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@
2727
import java.net.HttpURLConnection;
2828
import java.time.Duration;
2929
import java.util.ArrayList;
30+
import java.util.Arrays;
3031
import java.util.Collection;
3132
import java.util.List;
3233
import java.util.concurrent.BrokenBarrierException;
3334
import java.util.concurrent.CountDownLatch;
3435
import java.util.concurrent.CyclicBarrier;
3536
import java.util.concurrent.atomic.AtomicInteger;
3637
import java.util.concurrent.atomic.AtomicReference;
38+
import okhttp3.Protocol;
3739
import org.junit.Assert;
3840
import org.junit.Before;
3941
import org.junit.Test;
@@ -73,6 +75,12 @@ public static Collection<Object[]> constructorFeeder() {
7375
public LeaderElectorTest(LockType lockType) {
7476
try {
7577
apiClient = ClientBuilder.defaultClient();
78+
apiClient.setHttpClient(
79+
apiClient
80+
.getHttpClient()
81+
.newBuilder()
82+
.protocols(Arrays.asList(Protocol.HTTP_1_1))
83+
.build());
7684
} catch (IOException ex) {
7785
throw new RuntimeException("Couldn't create ApiClient", ex);
7886
}
@@ -185,7 +193,7 @@ public void testMultiCandidateLeaderElection() throws Exception {
185193
Assert.assertEquals(1, stopBeingLeaderCount.get());
186194
}
187195

188-
@Test(timeout = 30000L)
196+
@Test(timeout = 45000L)
189197
public void testLeaderGracefulShutdown() throws Exception {
190198
CountDownLatch startBeingLeader1 = new CountDownLatch(1);
191199
CountDownLatch stopBeingLeader1 = new CountDownLatch(1);

0 commit comments

Comments
 (0)