@@ -213,16 +213,8 @@ public Database createDatabase(Database database) throws IOException {
213213 }
214214 Database response = post (v1 (BDBS ), database , Database .class );
215215 long uid = response .getUid ();
216- Awaitility .await ().pollInterval (Duration .ofSeconds (1 )).until (() -> {
217- Command command = new Command ();
218- command .setCommand ("PING" );
219- try {
220- return executeCommand (uid , command ).getResponse ().asBoolean ();
221- } catch (HttpResponseException e ) {
222- log .info ("PING unsuccessful, retrying..." );
223- return false ;
224- }
225- });
216+ Awaitility .await ().pollInterval (Duration .ofSeconds (1 )).ignoreExceptions ()
217+ .until (() -> executeCommand (uid , new Command ("PING" )).getResponse ().asBoolean ());
226218 return response ;
227219 }
228220
@@ -256,20 +248,13 @@ public ModuleInstallResponse installModule(String filename, InputStream inputStr
256248 ModuleInstallResponse response = read (post , SimpleType .constructUnsafe (ModuleInstallResponse .class ),
257249 HttpStatus .SC_ACCEPTED );
258250 baos .close ();
259- Awaitility .await ().timeout (Duration .ofMinutes (1 )).pollInterval (Duration .ofSeconds (1 )).until (() -> {
260- log .info ("Checking status of action {}" , response .getActionUid ());
261- Action status = getAction (response .getActionUid ());
262- if ("completed" .equals (status .getStatus ())) {
263- return true ;
264- }
265- log .info ("Action {} status: {}" , response .getActionUid (), status .getStatus ());
266- return false ;
267- });
251+ Awaitility .await ().timeout (Duration .ofMinutes (1 )).pollInterval (Duration .ofSeconds (1 )).ignoreExceptions ()
252+ .until (() -> "completed" .equals (getAction (response .getActionUid ()).getStatus ()));
268253 return response ;
269254 }
270255
271256 public void waitForBoostrap () {
272- Awaitility .await ().pollInterval (Duration .ofSeconds (1 )).timeout (Duration .ofMinutes (1 ))
257+ Awaitility .await ().timeout (Duration .ofMinutes (1 )).pollInterval (Duration .ofSeconds (1 )). ignoreExceptions ( )
273258 .until (() -> "idle" .equals (getBootstrap ().getStatus ().getState ()));
274259
275260 }
0 commit comments