5151import java .util .ArrayList ;
5252import java .util .Collections ;
5353import java .util .List ;
54+ import java .util .concurrent .TimeUnit ;
5455import java .util .logging .*;
5556
5657public 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