Skip to content

Commit 8a43055

Browse files
authored
Merge pull request #248 from oracle/jenkins-timeout
Increase socket timeout for k8s calls
2 parents d0d0e32 + 149d18b commit 8a43055

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

operator/src/test/java/oracle/kubernetes/operator/HealthCheckHelperTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import java.util.ArrayList;
5252
import java.util.Collections;
5353
import java.util.List;
54+
import java.util.concurrent.TimeUnit;
5455
import java.util.logging.*;
5556

5657
public class HealthCheckHelperTest {
@@ -66,6 +67,9 @@ public class HealthCheckHelperTest {
6667
private List<Handler> savedHandlers = new ArrayList<>();
6768

6869
private UserProjects userProjects;
70+
71+
private ApiClient apiClient;
72+
private CoreV1Api core;
6973

7074
@Before
7175
public void setUp() throws Exception {
@@ -83,6 +87,13 @@ public void setUp() throws Exception {
8387
unitHealthCheckHelper = new HealthCheckHelper(UNIT_NAMESPACE, Collections.singleton(UNIT_NAMESPACE));
8488

8589
userProjects = UserProjects.createUserProjectsDirectory();
90+
91+
apiClient = Config.defaultClient();
92+
core = new CoreV1Api(apiClient);
93+
94+
// Ensure that client doesn't time out before call or watch
95+
apiClient.getHttpClient().setReadTimeout(5, TimeUnit.MINUTES);
96+
8697
}
8798

8899
@After
@@ -101,8 +112,6 @@ public void testAccountNoPrivs() throws Exception {
101112
Assume.assumeTrue(TestUtils.isKubernetesAvailable());
102113

103114
// Create service account
104-
ApiClient apiClient= Config.defaultClient();
105-
CoreV1Api core = new CoreV1Api(apiClient);
106115
V1ServiceAccount alice = new V1ServiceAccount();
107116
alice.setMetadata(new V1ObjectMeta().name("alice"));
108117
try {
@@ -158,8 +167,6 @@ public void testAccountPrivs() throws Exception {
158167
Assume.assumeTrue(TestUtils.isKubernetesAvailable());
159168

160169
// Create service account
161-
ApiClient apiClient= Config.defaultClient();
162-
CoreV1Api core = new CoreV1Api(apiClient);
163170
V1ServiceAccount theo = new V1ServiceAccount();
164171
theo.setMetadata(new V1ObjectMeta().name("theo"));
165172
try {

0 commit comments

Comments
 (0)