@@ -123,9 +123,7 @@ public void testPollingModeSpecialHttpConfigurations() throws Exception {
123123 new LDConfig .Builder ()
124124 .dataSource (Components .pollingDataSource ().baseURI (serverUri ))
125125 .events (noEvents ())
126- .http (httpConfig )
127- .startWait (Duration .ofMillis (100 ))
128- .build ());
126+ .http (httpConfig ));
129127 }
130128
131129 @ Test
@@ -208,9 +206,7 @@ public void testStreamingModeSpecialHttpConfigurations() throws Exception {
208206 new LDConfig .Builder ()
209207 .dataSource (Components .streamingDataSource ().baseURI (serverUri ))
210208 .events (noEvents ())
211- .http (httpConfig )
212- .startWait (Duration .ofMillis (100 ))
213- .build ());
209+ .http (httpConfig ));
214210 }
215211
216212 @ Test
@@ -254,17 +250,21 @@ public void clientSendsDiagnosticEvent() throws Exception {
254250 }
255251
256252 private static void testWithSpecialHttpConfigurations (Handler handler ,
257- BiFunction <URI , HttpConfigurationFactory , LDConfig > makeConfig ) throws Exception {
253+ BiFunction <URI , HttpConfigurationFactory , LDConfig . Builder > makeConfig ) throws Exception {
258254 TestHttpUtil .testWithSpecialHttpConfigurations (handler ,
259255 (serverUri , httpConfig ) -> {
260- LDConfig config = makeConfig .apply (serverUri , httpConfig );
256+ LDConfig config = makeConfig .apply (serverUri , httpConfig )
257+ .startWait (Duration .ofSeconds (10 )) // allow extra time to be sure it can connect
258+ .build ();
261259 try (LDClient client = new LDClient (sdkKey , config )) {
262260 assertTrue (client .isInitialized ());
263261 assertTrue (client .boolVariation (flagKey , user , false ));
264262 }
265263 },
266264 (serverUri , httpConfig ) -> {
267- LDConfig config = makeConfig .apply (serverUri , httpConfig );
265+ LDConfig config = makeConfig .apply (serverUri , httpConfig )
266+ .startWait (Duration .ofMillis (100 )) // don't wait terribly long when we don't expect it to succeed
267+ .build ();
268268 try (LDClient client = new LDClient (sdkKey , config )) {
269269 assertFalse (client .isInitialized ());
270270 }
0 commit comments